118 lines
4.3 KiB
C#
118 lines
4.3 KiB
C#
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_MODEL.Page;
|
|
using System.Collections.Generic;
|
|
using GThinking.N_MISPRO.Data;
|
|
using GThinking.N_MISPRO;
|
|
using GThinking.N_MISPRO.Utility;
|
|
|
|
namespace GThinking.N_XLXSBJ
|
|
{
|
|
[TableMap(DB = "DBERP", DbTableName = "XLXSBJD", Umid = 100860000, IsWorkFlow = false, IsAttach = false, UseWhr = false,
|
|
QuerySelSql = "")]
|
|
public class XLBJD_JGMLXZEntity : EntityManager
|
|
{
|
|
|
|
}
|
|
|
|
public partial class XLBJD_JGMLXZ : SingleCardBase
|
|
{
|
|
XLBJD_JGMLXZEntity entity = new XLBJD_JGMLXZEntity();
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
this.UMID = 100860000;
|
|
this.UMName = "线缆销售报价单";
|
|
this.CurMaster = Master;
|
|
this.CurEntity = entity;
|
|
this.PageHeight = 200;
|
|
this.PageWidth = 500;
|
|
|
|
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;
|
|
|
|
base.InitPage();
|
|
|
|
if (!IsPostBack)
|
|
{
|
|
InitControl();
|
|
}
|
|
}
|
|
|
|
private void SetcbxJGBID()
|
|
{
|
|
string sBJU053 = GetOption(100860018, "BJU053");
|
|
Dictionary<string, string> dicJGBID = new Dictionary<string, string>();
|
|
dicJGBID = XLBJDUtils.GetJGBIDByXSQYID("", PageParam.GetRTrimString("BJFLID"), PageParam.GetRTrimString("BJRQ"), PageParam.GetRTrimString("XSQYID"));
|
|
cbxJGBID.ClearItems();
|
|
foreach (KeyValuePair<string, string> kvp in dicJGBID)
|
|
{
|
|
if (sBJU053.Contains(kvp.Key) || sBJU053.Equals(""))
|
|
cbxJGBID.Items.Add(new ListItem(kvp.Value, kvp.Key));
|
|
}
|
|
}
|
|
|
|
private void InitControl()
|
|
{
|
|
SetcbxJGBID();
|
|
}
|
|
|
|
protected void btnQR_Click(object sender, EventArgs e)
|
|
{
|
|
if (cbxJGBID.SelectedValue.Trim().Equals(""))
|
|
{
|
|
ShowMessage("请选择价格表!");
|
|
return;
|
|
}
|
|
string sBJDID = PageParam.GetRTrimString("BJDID");
|
|
TDatabase dberp = TContextDatabases.GetDatabase("DBERP");
|
|
TSQL SQL = new TSQL(dberp);
|
|
try
|
|
{
|
|
dberp.BeginTrans();
|
|
Dictionary<string, string> dicTLJG = XLBJDInfo.GetTLJByRQ(PageParam.GetRTrimString("BJRQ"), PageParam.GetRTrimString("BJFLID"), PageParam.GetRTrimString("HSBZ")=="Y", cbxJGBID.SelectedValue.Trim());
|
|
double dTJ = CMISproConvert.StrToFloat(dicTLJG["TJ"], 0);
|
|
double dLJ = CMISproConvert.StrToFloat(dicTLJG["LJ"], 0);
|
|
SQL.Clear();
|
|
SQL.Add("update XLXSBJD set XLXSBJD_JGBID=:pJGBID,XLXSBJD_TJ=:pTJ,XLXSBJD_LJ=:pLJ where XLXSBJD_BJDID=:pBJDID");
|
|
SQL.ParamByName("pJGBID").Value = cbxJGBID.SelectedValue.Trim();
|
|
SQL.ParamByName("pTJ").Value = dTJ;
|
|
SQL.ParamByName("pLJ").Value = dLJ;
|
|
SQL.ParamByName("pBJDID").Value = sBJDID;
|
|
dberp.ExecSQL(SQL);
|
|
|
|
string sErrMsg = string.Empty;
|
|
XLBJDCalcUtils.CalcAfterBJDHQChange(dberp, SQL, sBJDID, 1, GetOption("BJU002"), GetOption("BJU003"), GetOption("BJU018"), tSession.UserId, tSession.UserName, CalcAction.ReCalc, "", ref sErrMsg);
|
|
if (!string.IsNullOrEmpty(sErrMsg))
|
|
throw new Exception(sErrMsg);
|
|
dberp.CommitTrans();
|
|
CloseWindow();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
ShowMessage("切换价格表出现异常,请联系系统管理员!错误原因:" + ex);
|
|
dberp.RollbackTrans();
|
|
}
|
|
}
|
|
|
|
protected void btnQX_Click(object sender, EventArgs e)
|
|
{
|
|
CloseWindow();
|
|
}
|
|
}
|
|
}
|