2026821
This commit is contained in:
@@ -0,0 +1,164 @@
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Configuration;
|
||||
using System.Collections;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.UI.WebControls.WebParts;
|
||||
using System.Web.UI.HtmlControls;
|
||||
using GThinking.N_MISPRO;
|
||||
using GThinking.N_MISPRO.Data;
|
||||
using GThinking.N_MODEL.Page;
|
||||
using GThinking.N_PUBLIC;
|
||||
using GThinking.N_MISPRO.Utility;
|
||||
using System.Text.RegularExpressions;
|
||||
using GThinking.N_CONTROL;
|
||||
|
||||
namespace GThinking.N_XLXSBJ
|
||||
{
|
||||
public partial class BJYFJZQJ_JSGSInfo : SingleCardBase
|
||||
{
|
||||
BJYFJZQJ_ZDXJGS entity = new BJYFJZQJ_ZDXJGS();
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.UMID = 100860071;
|
||||
this.UMName = "线缆销售报价单运费";
|
||||
this.CurMaster = Master;
|
||||
this.CurEntity = entity;
|
||||
this.Master.EnableAttachBtn = false;
|
||||
this.PageWidth = 420;
|
||||
this.PageHeight = 180;
|
||||
Master.EnableAttachBtn = false;
|
||||
Master.EnableCancelBtn = false;
|
||||
Master.EnableCopyBtn = false;
|
||||
Master.EnableDeleteBtn = false;
|
||||
Master.EnableEditBtn = false;
|
||||
Master.EnableInsertBtn = false;
|
||||
Master.EnablePrintBtn = false;
|
||||
Master.EnableRefreshBtn = false;
|
||||
Master.EnableSaveBtn = false;
|
||||
if (PageParam.GetRTrimString("YFJSFS").Equals("1"))
|
||||
{
|
||||
LinkYJ.Visible = true;
|
||||
LinkYJU.Visible = false;
|
||||
LinkYL.Visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
LinkYJ.Visible = false;
|
||||
LinkYJU.Visible = true;
|
||||
LinkYL.Visible = true;
|
||||
}
|
||||
base.InitPage();
|
||||
|
||||
if (!IsPostBack)
|
||||
{
|
||||
InitControl();
|
||||
}
|
||||
}
|
||||
|
||||
#region 模板事件继承
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 控件事件
|
||||
|
||||
protected void LinkYJ_Click(object sender, EventArgs e)
|
||||
{
|
||||
txtYFJSGS.Text = txtYFJSGS.Text + "运价";
|
||||
}
|
||||
protected void LinkYJU_Click(object sender, EventArgs e)
|
||||
{
|
||||
txtYFJSGS.Text = txtYFJSGS.Text + "运距";
|
||||
}
|
||||
|
||||
protected void LinkYL_Click(object sender, EventArgs e)
|
||||
{
|
||||
txtYFJSGS.Text = txtYFJSGS.Text + "运率";
|
||||
}
|
||||
|
||||
protected void LinkYZ_Click(object sender, EventArgs e)
|
||||
{
|
||||
txtYFJSGS.Text = txtYFJSGS.Text + "运重";
|
||||
}
|
||||
|
||||
protected void btnOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
TDatabase dberp = TContextDatabases.GetDatabase("DBERP");
|
||||
TSQL SQL = new TSQL(dberp);
|
||||
SQL.Clear();
|
||||
string sYFJZQH = PageParam.GetRTrimString("YFJZQH");
|
||||
//校验公式
|
||||
if (!txtYFJSGS.Text.Trim().Equals(""))
|
||||
{
|
||||
string sTmp = XLBJDUtils.SubStringFunc(txtYFJSGS.Text.Trim(), 60);
|
||||
if (!sTmp.Equals(txtYFJSGS.Text.Trim()))
|
||||
{
|
||||
ShowMessage("公式超长!");
|
||||
return;
|
||||
}
|
||||
|
||||
gtExpression exp = new gtExpression();
|
||||
|
||||
sTmp = sTmp.Replace(" ", "").Replace("运价", "7.1").Replace("运重", "9.4").Replace("运率", "7.1").Replace("运距", "9.4").Replace("×", "*");
|
||||
|
||||
try
|
||||
{
|
||||
double dZBZ = NumberUtils.RoundX(exp.Evaluate(sTmp), 4);
|
||||
}
|
||||
catch
|
||||
{
|
||||
ShowMessage("公式存在语法错误!");
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (PageParam.GetRTrimString("YFJSFS").Equals("1"))
|
||||
{
|
||||
//更新数据
|
||||
SQL.Clear();
|
||||
SQL.Add(" UPDATE XLXSBJYFJZQJ SET XLXSBJYFJZQJ_YFJSGS = :pXLXSBJYFJZQJ_YFJSGS where XLXSBJYFJZQJ_YFJZQH = :pXLXSBJYFJZQJ_YFJZQH ");
|
||||
SQL.ParamByName("pXLXSBJYFJZQJ_YFJSGS").Value = txtYFJSGS.Text.Trim();
|
||||
SQL.ParamByName("pXLXSBJYFJZQJ_YFJZQH").Value = sYFJZQH;
|
||||
dberp.ExecSQL(SQL);
|
||||
}
|
||||
else
|
||||
{
|
||||
//更新数据
|
||||
SQL.Clear();
|
||||
SQL.Add(" UPDATE XLXSBJYFJZQJ SET XLXSBJYFJZQJ_YFJSGS3 = :pXLXSBJYFJZQJ_YFJSGS3 where XLXSBJYFJZQJ_YFJZQH = :pXLXSBJYFJZQJ_YFJZQH ");
|
||||
SQL.ParamByName("pXLXSBJYFJZQJ_YFJSGS3").Value = txtYFJSGS.Text.Trim();
|
||||
SQL.ParamByName("pXLXSBJYFJZQJ_YFJZQH").Value = sYFJZQH;
|
||||
dberp.ExecSQL(SQL);
|
||||
}
|
||||
|
||||
//
|
||||
DialogOperationScript dos = new DialogOperationScript(this);
|
||||
dos.ClickOwnerButton(PageParam.GetRTrimString("btnRefreshCID"));
|
||||
dos.CloseSelf();
|
||||
dos.Execute();
|
||||
}
|
||||
|
||||
protected void btnQX_Click(object sender, EventArgs e)
|
||||
{
|
||||
CloseWindow();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 私有函数
|
||||
private void InitControl()
|
||||
{
|
||||
if (!PageParam.GetRTrimString("YFJSGS").Equals(""))
|
||||
{
|
||||
txtYFJSGS.Text = PageParam.GetRTrimString("YFJSGS");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user