You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSCustomerWeb/PriceCarrier/CrmPriceCarrierInfo.aspx.cs

686 lines
34 KiB
C#

2 years ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Text;
using DSWeb.DataAccess;
using System.Data.SqlClient;
using DSWeb.Models;
using DSWeb.EntityDA;
using System.Web.Script.Serialization;
using JsonHelper;
using DSWeb.Log;
namespace DSWeb.PriceCarrier
{
public partial class CrmPriceCarrierInfo : System.Web.UI.Page
{
CrmPriceCarrierEntity CrmPriceCarrierEntity = new CrmPriceCarrierEntity();
CrmPriceCarrierDA CrmPriceCarrierDA = new CrmPriceCarrierDA();
public string strHandleType = String.Empty;
public string strUserID;//用户GID
protected void Page_Load(object sender, EventArgs e)
{
if (Session["USERID"] != null)
{
strUserID = Session["USERID"].ToString().Trim();
this.hdUserID.Value = strUserID.Trim();
}
else
{
Server.Transfer("~/Error/FriendError.aspx");
return;
}
//
if (!IsPostBack)
{
if (Request.QueryString["handle"] != null)
{
Session["strHandleType"] = Request.QueryString["handle"].ToString();//"edit";
strHandleType = Session["strHandleType"].ToString().Trim();
this.hdHandle.Value = Session["strHandleType"].ToString().Trim();
//
if (Request.QueryString["id"] != null)
{
Session["GID"] = Request.QueryString["id"].ToString();
this.hdGid.Value = Session["GID"].ToString().Trim();
}
//
switch (strHandleType)
{
case "add"://新增
getaddnull();
//
ibDel.Enabled = false;
ibAdd.Enabled = false;
ibFullAdd.Enabled = false;
btSubmit.Enabled = false;
break;
case "addfull"://新增
btSubmit.Text = "解锁";
//
CrmPriceCarrierEntity = CrmPriceCarrierDA.GetID(Session["GID"].ToString().Trim());
if (CrmPriceCarrierEntity.GID != null)
{
this.hd_comboPODLOAD.Value = CrmPriceCarrierEntity.PODLOAD.ToString().Trim();
this.hd_comboPORTDISCHARGE.Value = CrmPriceCarrierEntity.PORTDISCHARGE.ToString().Trim();
tbDESTINATION.Text = CrmPriceCarrierEntity.DESTINATION.ToString().Trim();
this.hd_comboVIA.Value = CrmPriceCarrierEntity.VIA.ToString().Trim();
tbPOC.Text = CrmPriceCarrierEntity.POC.ToString().Trim();
this.hd_comboLANE.Value = CrmPriceCarrierEntity.LANE.ToString().Trim();
tbCARRIERLANE.Text = CrmPriceCarrierEntity.CARRIERLANE.ToString().Trim();
this.hd_comboCARRIE.Value = CrmPriceCarrierEntity.CARRIE.ToString().Trim();
this.hd_comboFORWARDER.Value = CrmPriceCarrierEntity.FORWARDER.ToString().Trim();
this.hd_comboETD.Value = CrmPriceCarrierEntity.ETD.ToString().Trim();
tbTT.Text = CrmPriceCarrierEntity.TT.ToString().Trim();
this.hd_comboSVC.Value = CrmPriceCarrierEntity.SVC.ToString().Trim();
tbSC.Text = CrmPriceCarrierEntity.SC.ToString().Trim();
tbNAMEAC.Text = CrmPriceCarrierEntity.NAMEAC.ToString().Trim();
this.hd_comboSICUT.Value = CrmPriceCarrierEntity.SICUT.ToString().Trim();
this.hd_comboCUSCLSG.Value = CrmPriceCarrierEntity.CUSCLSG.ToString().Trim();
this.hd_comboCYCLSG.Value = CrmPriceCarrierEntity.CYCLSG.ToString().Trim();
tbOWS.Text = CrmPriceCarrierEntity.OWS.ToString().Trim();
tbCOMMODITY.Text = CrmPriceCarrierEntity.COMMODITY.ToString().Trim();
tb20GP0.Text = CrmPriceCarrierEntity.D_20GP0.ToString().Trim();
tb40GP0.Text = CrmPriceCarrierEntity.D_40GP0.ToString().Trim();
tb40HQ0.Text = CrmPriceCarrierEntity.D_40HQ0.ToString().Trim();
tb45HQ0.Text = CrmPriceCarrierEntity.D_45HQ0.ToString().Trim();
tb20GP1.Text = CrmPriceCarrierEntity.D_20GP1.ToString().Trim();
tb40GP1.Text = CrmPriceCarrierEntity.D_40GP1.ToString().Trim();
tb40HQ1.Text = CrmPriceCarrierEntity.D_40HQ1.ToString().Trim();
tb45HQ1.Text = CrmPriceCarrierEntity.D_45HQ1.ToString().Trim();
tb20GP2.Text = CrmPriceCarrierEntity.D_20GP2.ToString().Trim();
tb40GP2.Text = CrmPriceCarrierEntity.D_40GP2.ToString().Trim();
tb40HQ2.Text = CrmPriceCarrierEntity.D_40HQ2.ToString().Trim();
tb45HQ2.Text = CrmPriceCarrierEntity.D_45HQ2.ToString().Trim();
tb20GP3.Text = CrmPriceCarrierEntity.D_20GP3.ToString().Trim();
tb40GP3.Text = CrmPriceCarrierEntity.D_40GP3.ToString().Trim();
tb40HQ3.Text = CrmPriceCarrierEntity.D_40HQ3.ToString().Trim();
tb45HQ3.Text = CrmPriceCarrierEntity.D_45HQ3.ToString().Trim();
//
if (CrmPriceCarrierEntity.VALIDDATE.ToString().Trim().Equals("0001-1-1 0:00:00"))
{
tbVALIDDATE.Text = "";
}
else
{
tbVALIDDATE.Text = CrmPriceCarrierEntity.VALIDDATE.ToString("yyyy-MM-dd").Trim();
}
if (CrmPriceCarrierEntity.EFFECTIVEDATE.ToString().Trim().Equals("0001-1-1 0:00:00"))
{
tbEFFECTIVEDATE.Text = "";
}
else
{
tbEFFECTIVEDATE.Text = CrmPriceCarrierEntity.EFFECTIVEDATE.ToString("yyyy-MM-dd").Trim();
}
//
Session["GID"] = getBSNO();
this.hdGid.Value = Session["GID"].ToString().Trim();
//
ibDel.Enabled = false;
ibAdd.Enabled = false;
ibFullAdd.Enabled = false;
btSubmit.Enabled = false;
}
else
{
Session["strHandleType"] = "add";
strHandleType = "add";
this.hdHandle.Value = Session["strHandleType"].ToString().Trim();
getaddnull();
//
ibDel.Enabled = false;
ibAdd.Enabled = false;
ibFullAdd.Enabled = false;
btSubmit.Enabled = false;
}
break;
case "edit"://录入
CrmPriceCarrierEntity = CrmPriceCarrierDA.GetID(Session["GID"].ToString().Trim());
if (CrmPriceCarrierEntity.GID != null)
{
this.hd_comboPODLOAD.Value = CrmPriceCarrierEntity.PODLOAD.ToString().Trim();
this.hd_comboPORTDISCHARGE.Value = CrmPriceCarrierEntity.PORTDISCHARGE.ToString().Trim();
tbDESTINATION.Text = CrmPriceCarrierEntity.DESTINATION.ToString().Trim();
this.hd_comboVIA.Value = CrmPriceCarrierEntity.VIA.ToString().Trim();
tbPOC.Text = CrmPriceCarrierEntity.POC.ToString().Trim();
this.hd_comboLANE.Value = CrmPriceCarrierEntity.LANE.ToString().Trim();
tbCARRIERLANE.Text = CrmPriceCarrierEntity.CARRIERLANE.ToString().Trim();
this.hd_comboCARRIE.Value = CrmPriceCarrierEntity.CARRIE.ToString().Trim();
this.hd_comboFORWARDER.Value = CrmPriceCarrierEntity.FORWARDER.ToString().Trim();
this.hd_comboETD.Value = CrmPriceCarrierEntity.ETD.ToString().Trim();
tbTT.Text = CrmPriceCarrierEntity.TT.ToString().Trim();
this.hd_comboSVC.Value = CrmPriceCarrierEntity.SVC.ToString().Trim();
tbSC.Text = CrmPriceCarrierEntity.SC.ToString().Trim();
tbNAMEAC.Text = CrmPriceCarrierEntity.NAMEAC.ToString().Trim();
this.hd_comboSICUT.Value = CrmPriceCarrierEntity.SICUT.ToString().Trim();
this.hd_comboCUSCLSG.Value = CrmPriceCarrierEntity.CUSCLSG.ToString().Trim();
this.hd_comboCYCLSG.Value = CrmPriceCarrierEntity.CYCLSG.ToString().Trim();
tbOWS.Text = CrmPriceCarrierEntity.OWS.ToString().Trim();
tbCOMMODITY.Text = CrmPriceCarrierEntity.COMMODITY.ToString().Trim();
tb20GP0.Text = CrmPriceCarrierEntity.D_20GP0.ToString().Trim();
tb40GP0.Text = CrmPriceCarrierEntity.D_40GP0.ToString().Trim();
tb40HQ0.Text = CrmPriceCarrierEntity.D_40HQ0.ToString().Trim();
tb45HQ0.Text = CrmPriceCarrierEntity.D_45HQ0.ToString().Trim();
tb20GP1.Text = CrmPriceCarrierEntity.D_20GP1.ToString().Trim();
tb40GP1.Text = CrmPriceCarrierEntity.D_40GP1.ToString().Trim();
tb40HQ1.Text = CrmPriceCarrierEntity.D_40HQ1.ToString().Trim();
tb45HQ1.Text = CrmPriceCarrierEntity.D_45HQ1.ToString().Trim();
tb20GP2.Text = CrmPriceCarrierEntity.D_20GP2.ToString().Trim();
tb40GP2.Text = CrmPriceCarrierEntity.D_40GP2.ToString().Trim();
tb40HQ2.Text = CrmPriceCarrierEntity.D_40HQ2.ToString().Trim();
tb45HQ2.Text = CrmPriceCarrierEntity.D_45HQ2.ToString().Trim();
tb20GP3.Text = CrmPriceCarrierEntity.D_20GP3.ToString().Trim();
tb40GP3.Text = CrmPriceCarrierEntity.D_40GP3.ToString().Trim();
tb40HQ3.Text = CrmPriceCarrierEntity.D_40HQ3.ToString().Trim();
tb45HQ3.Text = CrmPriceCarrierEntity.D_45HQ3.ToString().Trim();
//
if (CrmPriceCarrierEntity.VALIDDATE.ToString().Trim().Equals("0001-1-1 0:00:00"))
{
tbVALIDDATE.Text = "";
}
else
{
tbVALIDDATE.Text = CrmPriceCarrierEntity.VALIDDATE.ToString("yyyy-MM-dd").Trim();
}
if (CrmPriceCarrierEntity.EFFECTIVEDATE.ToString().Trim().Equals("0001-1-1 0:00:00"))
{
tbEFFECTIVEDATE.Text = "";
}
else
{
tbEFFECTIVEDATE.Text = CrmPriceCarrierEntity.EFFECTIVEDATE.ToString("yyyy-MM-dd").Trim();
}
//
if (CrmPriceCarrierEntity.LOCKFLAG)
{
getEnabled();
btSubmit.Text = "解锁";
this.hdLOCKFLAG.Value = "1";
}
else
{
getEnabledTrue();
btSubmit.Text = "锁定";
this.hdLOCKFLAG.Value = "0";
}
}
else
{
Session["strHandleType"] = "add";
strHandleType = "add";
this.hdHandle.Value = Session["strHandleType"].ToString().Trim();
getaddnull();
//
ibDel.Enabled = false;
ibAdd.Enabled = false;
ibFullAdd.Enabled = false;
btSubmit.Enabled = false;
}
break;
}
}
else
{
}
}
//集装箱
if (Session["GID"] != null)
{
if (this.hdEnter.Value != "")
{
getEnter();
}
if (Session["GID"].ToString().Trim().Equals(""))
{
this.hdGid.Value = Session["GID"].ToString().Trim();
}
else
{
this.hdGid.Value = Session["GID"].ToString().Trim();
}
}
else
{
//Response.Write("-1");
//Response.End();
}
//加载下拉框
Page.ClientScript.RegisterStartupScript(this.GetType(), "key0", "<script>initcomboCARRIE();initComboFORWARDER();initComboPODLOAD();initComboVIA();initComboPORTDISCHARGE();initComboSVC();initComboLANE();initcomboETD();initcomboSICUT();initcomboCUSCLSG();initcomboCYCLSG();</script>");
}
protected void getEnabled()
{
ibAdd.Enabled = false;
ibFullAdd.Enabled = false;
divibEnter.Disabled = true;
imgFresh.Disabled = true;
ibDel.Enabled = false;
btSubmit.Enabled = false;
//
this.hd_comboPODLOAD.Disabled = true;
this.hd_comboPORTDISCHARGE.Disabled = true;
tbDESTINATION.Enabled = false;
this.hd_comboVIA.Disabled = true;
tbPOC.Enabled = false;
this.hd_comboLANE.Disabled = true;
tbCARRIERLANE.Enabled = false;
this.hd_comboCARRIE.Disabled = true;
this.hd_comboFORWARDER.Disabled = true;
this.hd_comboETD.Disabled = true;
tbTT.Enabled = false;
tbVALIDDATE.Enabled = false;
tbEFFECTIVEDATE.Enabled = false;
this.hd_comboSVC.Disabled = true;
tbSC.Enabled = false;
tbNAMEAC.Enabled = false;
this.hd_comboSICUT.Disabled = true;
this.hd_comboCUSCLSG.Disabled = true;
this.hd_comboCYCLSG.Disabled = true;
tbOWS.Enabled = false;
tbCOMMODITY.Enabled = false;
tb20GP0.Enabled = false;
tb40GP0.Enabled = false;
tb40HQ0.Enabled = false;
tb45HQ0.Enabled = false;
tb20GP1.Enabled = false;
tb40GP1.Enabled = false;
tb40HQ1.Enabled = false;
tb45HQ1.Enabled = false;
tb20GP2.Enabled = false;
tb40GP2.Enabled = false;
tb40HQ2.Enabled = false;
tb45HQ2.Enabled = false;
tb20GP3.Enabled = false;
tb40GP3.Enabled = false;
tb40HQ3.Enabled = false;
tb45HQ3.Enabled = false;
}
protected void getEnabledTrue()
{
ibAdd.Enabled = true;
ibFullAdd.Enabled = true;
divibEnter.Disabled = false;
imgFresh.Disabled = false;
ibDel.Enabled = true;
btSubmit.Enabled = true;
//
this.hd_comboPODLOAD.Disabled = false;
this.hd_comboPORTDISCHARGE.Disabled = false;
this.hd_comboVIA.Disabled = false;
this.hd_comboCARRIE.Disabled = false;
this.hd_comboFORWARDER.Disabled = false;
this.hd_comboETD.Disabled = false;
this.hd_comboLANE.Disabled = false;
this.hd_comboSVC.Disabled = false;
this.hd_comboSICUT.Disabled = false;
this.hd_comboCUSCLSG.Disabled = false;
this.hd_comboCYCLSG.Disabled = false;
tbDESTINATION.Enabled = true;
tbPOC.Enabled = true;
tbCARRIERLANE.Enabled = true;
tbTT.Enabled = true;
tbVALIDDATE.Enabled = true;
tbEFFECTIVEDATE.Enabled = true;
tbSC.Enabled = true;
tbNAMEAC.Enabled = true;
tbOWS.Enabled = true;
tbCOMMODITY.Enabled = true;
tb20GP0.Enabled = true;
tb40GP0.Enabled = true;
tb40HQ0.Enabled = true;
tb45HQ0.Enabled = true;
tb20GP1.Enabled = true;
tb40GP1.Enabled = true;
tb40HQ1.Enabled = true;
tb45HQ1.Enabled = true;
tb20GP2.Enabled = true;
tb40GP2.Enabled = true;
tb40HQ2.Enabled = true;
tb45HQ2.Enabled = true;
tb20GP3.Enabled = true;
tb40GP3.Enabled = true;
tb40HQ3.Enabled = true;
tb45HQ3.Enabled = true;
}
protected String getBSNO()
{
string strBSNO = Guid.NewGuid().ToString();
strBSNO = strBSNO.Replace("-", "");
strBSNO = "CarP" + strBSNO;
return strBSNO;
}
protected void getaddnull()
{
getEnabledTrue();
//
btSubmit.Text = "锁定";
//
Session["GID"] = getBSNO();
this.hdGid.Value = Session["GID"].ToString().Trim();
//
T_ALL_DA T_ALL_DA = new T_ALL_DA();
this.hd_comboPODLOAD.Value = T_ALL_DA.GetStrSQL("PORTLOAD", "select PORTLOAD from subcomp_seae_def where CORPID=(select GID from company where GID=(select COMPANYID from user_company where USERID='" + strUserID + "') and ISDELETED=0 and ISDISABLE=0)");
this.hd_comboPORTDISCHARGE.Value="";
tbDESTINATION.Text="";
this.hd_comboVIA.Value="";
tbPOC.Text="";
this.hd_comboLANE.Value="";
tbCARRIERLANE.Text="";
this.hd_comboCARRIE.Value="";
this.hd_comboFORWARDER.Value="";
this.hd_comboETD.Value="";
tbTT.Text="";
tbVALIDDATE.Text="";
tbEFFECTIVEDATE.Text="";
this.hd_comboSVC.Value="";
tbSC.Text="";
tbNAMEAC.Text="";
this.hd_comboSICUT.Value="";
this.hd_comboCUSCLSG.Value="";
this.hd_comboCYCLSG.Value="";
tbOWS.Text="";
tbCOMMODITY.Text="";
tb20GP0.Text="0";
tb40GP0.Text="0";
tb40HQ0.Text="0";
tb45HQ0.Text="0";
tb20GP1.Text="0";
tb40GP1.Text="0";
tb40HQ1.Text="0";
tb45HQ1.Text="0";
tb20GP2.Text="0";
tb40GP2.Text="0";
tb40HQ2.Text="0";
tb45HQ2.Text="0";
tb20GP3.Text="0";
tb40GP3.Text="0";
tb40HQ3.Text="0";
tb45HQ3.Text="0";
//
ibDel.Enabled = false;
ibAdd.Enabled = false;
ibFullAdd.Enabled = false;
btSubmit.Enabled = false;
}
protected bool getAdd()
{
CrmPriceCarrierEntity.GID = Session["GID"].ToString().Trim();
CrmPriceCarrierEntity.PODLOAD = this.hd_comboPODLOAD.Value.Trim();
CrmPriceCarrierEntity.PORTDISCHARGE = this.hd_comboPORTDISCHARGE.Value.Trim();
CrmPriceCarrierEntity.DESTINATION = tbDESTINATION.Text.Trim();
CrmPriceCarrierEntity.VIA = this.hd_comboVIA.Value.Trim();
CrmPriceCarrierEntity.POC = tbPOC.Text.Trim();
CrmPriceCarrierEntity.LANE = this.hd_comboLANE.Value.Trim();
CrmPriceCarrierEntity.CARRIERLANE = tbCARRIERLANE.Text.Trim();
CrmPriceCarrierEntity.CARRIE = this.hd_comboCARRIE.Value.Trim();
CrmPriceCarrierEntity.FORWARDER = this.hd_comboFORWARDER.Value.Trim();
CrmPriceCarrierEntity.ETD = this.hd_comboETD.Value.Trim();
CrmPriceCarrierEntity.TT = tbTT.Text.Trim();
CrmPriceCarrierEntity.SVC = this.hd_comboSVC.Value.Trim();
CrmPriceCarrierEntity.SC = tbSC.Text.Trim();
CrmPriceCarrierEntity.NAMEAC = tbNAMEAC.Text.Trim();
CrmPriceCarrierEntity.SICUT = this.hd_comboSICUT.Value.Trim();
CrmPriceCarrierEntity.CUSCLSG = this.hd_comboCUSCLSG.Value.Trim();
CrmPriceCarrierEntity.CYCLSG = this.hd_comboCYCLSG.Value.Trim();
CrmPriceCarrierEntity.OWS = tbOWS.Text.Trim();
CrmPriceCarrierEntity.INPUTBY = strUserID;
CrmPriceCarrierEntity.COMMODITY = tbCOMMODITY.Text.Trim();
//
if (tbVALIDDATE.Text.Trim() != "")
{
CrmPriceCarrierEntity.VALIDDATE = DateTime.Parse(tbVALIDDATE.Text.Trim());
}
if (tbEFFECTIVEDATE.Text.Trim() != "")
{
CrmPriceCarrierEntity.EFFECTIVEDATE = DateTime.Parse(tbEFFECTIVEDATE.Text.Trim());
}
//
CrmPriceCarrierEntity.D_20GP0 = Decimal.Parse(tb20GP0.Text.Trim().Equals("") ? "0" : tb20GP0.Text.Trim());
CrmPriceCarrierEntity.D_40GP0 = Decimal.Parse(tb40GP0.Text.Trim().Equals("") ? "0" : tb40GP0.Text.Trim());
CrmPriceCarrierEntity.D_40HQ0 = Decimal.Parse(tb40HQ0.Text.Trim().Equals("") ? "0" : tb40HQ0.Text.Trim());
CrmPriceCarrierEntity.D_45HQ0 = Decimal.Parse(tb45HQ0.Text.Trim().Equals("") ? "0" : tb45HQ0.Text.Trim());
CrmPriceCarrierEntity.D_20GP1 = Decimal.Parse(tb20GP1.Text.Trim().Equals("") ? "0" : tb20GP1.Text.Trim());
CrmPriceCarrierEntity.D_40GP1 = Decimal.Parse(tb40GP1.Text.Trim().Equals("") ? "0" : tb40GP1.Text.Trim());
CrmPriceCarrierEntity.D_40HQ1 = Decimal.Parse(tb40HQ1.Text.Trim().Equals("") ? "0" : tb40HQ1.Text.Trim());
CrmPriceCarrierEntity.D_45HQ1 = Decimal.Parse(tb45HQ1.Text.Trim().Equals("") ? "0" : tb45HQ1.Text.Trim());
CrmPriceCarrierEntity.D_20GP2 = Decimal.Parse(tb20GP2.Text.Trim().Equals("") ? "0" : tb20GP2.Text.Trim());
CrmPriceCarrierEntity.D_40GP2 = Decimal.Parse(tb40GP2.Text.Trim().Equals("") ? "0" : tb40GP2.Text.Trim());
CrmPriceCarrierEntity.D_40HQ2 = Decimal.Parse(tb40HQ2.Text.Trim().Equals("") ? "0" : tb40HQ2.Text.Trim());
CrmPriceCarrierEntity.D_45HQ2 = Decimal.Parse(tb45HQ2.Text.Trim().Equals("") ? "0" : tb45HQ2.Text.Trim());
CrmPriceCarrierEntity.D_20GP3 = Decimal.Parse(tb20GP3.Text.Trim().Equals("") ? "0" : tb20GP3.Text.Trim());
CrmPriceCarrierEntity.D_40GP3 = Decimal.Parse(tb40GP3.Text.Trim().Equals("") ? "0" : tb40GP3.Text.Trim());
CrmPriceCarrierEntity.D_40HQ3 = Decimal.Parse(tb40HQ3.Text.Trim().Equals("") ? "0" : tb40HQ3.Text.Trim());
CrmPriceCarrierEntity.D_45HQ3 = Decimal.Parse(tb45HQ3.Text.Trim().Equals("") ? "0" : tb45HQ3.Text.Trim());
//
int iResult = CrmPriceCarrierDA.InserInfo(CrmPriceCarrierEntity);
if (iResult > 0)
{
Session["strHandleType"] = "edit";
this.hdHandle.Value = Session["strHandleType"].ToString().Trim();
return true;
}
else
{
return false;
}
}
protected bool getEdit()
{
CrmPriceCarrierEntity.GID = Session["GID"].ToString().Trim();
CrmPriceCarrierEntity.PODLOAD = this.hd_comboPODLOAD.Value.Trim();
CrmPriceCarrierEntity.PORTDISCHARGE = this.hd_comboPORTDISCHARGE.Value.Trim();
CrmPriceCarrierEntity.DESTINATION = tbDESTINATION.Text.Trim();
CrmPriceCarrierEntity.VIA = this.hd_comboVIA.Value.Trim();
CrmPriceCarrierEntity.POC = tbPOC.Text.Trim();
CrmPriceCarrierEntity.LANE = this.hd_comboLANE.Value.Trim();
CrmPriceCarrierEntity.CARRIERLANE = tbCARRIERLANE.Text.Trim();
CrmPriceCarrierEntity.CARRIE = this.hd_comboCARRIE.Value.Trim();
CrmPriceCarrierEntity.FORWARDER = this.hd_comboFORWARDER.Value.Trim();
CrmPriceCarrierEntity.ETD = this.hd_comboETD.Value.Trim();
CrmPriceCarrierEntity.TT = tbTT.Text.Trim();
CrmPriceCarrierEntity.SVC = this.hd_comboSVC.Value.Trim();
CrmPriceCarrierEntity.SC = tbSC.Text.Trim();
CrmPriceCarrierEntity.NAMEAC = tbNAMEAC.Text.Trim();
CrmPriceCarrierEntity.SICUT = this.hd_comboSICUT.Value.Trim();
CrmPriceCarrierEntity.CUSCLSG = this.hd_comboCUSCLSG.Value.Trim();
CrmPriceCarrierEntity.CYCLSG = this.hd_comboCYCLSG.Value.Trim();
CrmPriceCarrierEntity.OWS = tbOWS.Text.Trim();
CrmPriceCarrierEntity.MODIFIEDUSER = strUserID;
CrmPriceCarrierEntity.COMMODITY = tbCOMMODITY.Text.Trim();
//
if (tbVALIDDATE.Text.Trim() != "")
{
CrmPriceCarrierEntity.VALIDDATE = DateTime.Parse(tbVALIDDATE.Text.Trim());
}
if (tbEFFECTIVEDATE.Text.Trim() != "")
{
CrmPriceCarrierEntity.EFFECTIVEDATE = DateTime.Parse(tbEFFECTIVEDATE.Text.Trim());
}
//
CrmPriceCarrierEntity.D_20GP0 = Decimal.Parse(tb20GP0.Text.Trim().Equals("") ? "0" : tb20GP0.Text.Trim());
CrmPriceCarrierEntity.D_40GP0 = Decimal.Parse(tb40GP0.Text.Trim().Equals("") ? "0" : tb40GP0.Text.Trim());
CrmPriceCarrierEntity.D_40HQ0 = Decimal.Parse(tb40HQ0.Text.Trim().Equals("") ? "0" : tb40HQ0.Text.Trim());
CrmPriceCarrierEntity.D_45HQ0 = Decimal.Parse(tb45HQ0.Text.Trim().Equals("") ? "0" : tb45HQ0.Text.Trim());
CrmPriceCarrierEntity.D_20GP1 = Decimal.Parse(tb20GP1.Text.Trim().Equals("") ? "0" : tb20GP1.Text.Trim());
CrmPriceCarrierEntity.D_40GP1 = Decimal.Parse(tb40GP1.Text.Trim().Equals("") ? "0" : tb40GP1.Text.Trim());
CrmPriceCarrierEntity.D_40HQ1 = Decimal.Parse(tb40HQ1.Text.Trim().Equals("") ? "0" : tb40HQ1.Text.Trim());
CrmPriceCarrierEntity.D_45HQ1 = Decimal.Parse(tb45HQ1.Text.Trim().Equals("") ? "0" : tb45HQ1.Text.Trim());
CrmPriceCarrierEntity.D_20GP2 = Decimal.Parse(tb20GP2.Text.Trim().Equals("") ? "0" : tb20GP2.Text.Trim());
CrmPriceCarrierEntity.D_40GP2 = Decimal.Parse(tb40GP2.Text.Trim().Equals("") ? "0" : tb40GP2.Text.Trim());
CrmPriceCarrierEntity.D_40HQ2 = Decimal.Parse(tb40HQ2.Text.Trim().Equals("") ? "0" : tb40HQ2.Text.Trim());
CrmPriceCarrierEntity.D_45HQ2 = Decimal.Parse(tb45HQ2.Text.Trim().Equals("") ? "0" : tb45HQ2.Text.Trim());
CrmPriceCarrierEntity.D_20GP3 = Decimal.Parse(tb20GP3.Text.Trim().Equals("") ? "0" : tb20GP3.Text.Trim());
CrmPriceCarrierEntity.D_40GP3 = Decimal.Parse(tb40GP3.Text.Trim().Equals("") ? "0" : tb40GP3.Text.Trim());
CrmPriceCarrierEntity.D_40HQ3 = Decimal.Parse(tb40HQ3.Text.Trim().Equals("") ? "0" : tb40HQ3.Text.Trim());
CrmPriceCarrierEntity.D_45HQ3 = Decimal.Parse(tb45HQ3.Text.Trim().Equals("") ? "0" : tb45HQ3.Text.Trim());
//
int iResult = CrmPriceCarrierDA.UpdateInfo(CrmPriceCarrierEntity);
if (iResult > 0)
{
//Response.Write("<script>alert('成功提交!');window.opener.location.reload();history.back();</script>");
return true;
}
else
{
//Response.Write("<script>alert('出错,请重新填写!');history.back();</script>");
return false;
}
}
protected void getEnter()
{
bool bl = false;
strHandleType = Session["strHandleType"].ToString();
this.hdHandle.Value = Session["strHandleType"].ToString().Trim();
if (strHandleType.Equals("add"))//新增
{
bl = getAdd();
}
else if (strHandleType.Equals("addfull"))//新增
{
bl = getAdd();
}
else if (strHandleType.Equals("edit"))//录入
{
bl = getEdit();
}
this.hdEnter.Value = "";
//
if (bl)
{
//
ibDel.Enabled = true;
ibAdd.Enabled = true;
ibFullAdd.Enabled = true;
//window.opener.location.reload();history.back();
//Response.Write("<script>alert('成功提交!');</script>");
Page.ClientScript.RegisterStartupScript(this.GetType(), "key1", "<script>reloadParent('" + Session["GID"].ToString().Trim() + "');</script>");
return;
}
else
{
Response.Write("<script>alert('出错,请重新填写!');history.back();</script>");
return;
}
}
protected void ibFullAdd_Click(object sender, EventArgs e)
{
getEnabledTrue();
Session["strHandleType"] = "addfull";
this.hdHandle.Value = Session["strHandleType"].ToString().Trim();
Session["GID"] = getBSNO();
this.hdGid.Value = Session["GID"].ToString().Trim();
//
ibDel.Enabled = false;
ibAdd.Enabled = false;
ibFullAdd.Enabled = false;
btSubmit.Enabled = false;
}
protected void ibAdd_Click(object sender, EventArgs e)
{
getEnabledTrue();
Session["strHandleType"] = "add";
this.hdHandle.Value = Session["strHandleType"].ToString().Trim();
//
getaddnull();
//
ibDel.Enabled = false;
ibAdd.Enabled = false;
ibFullAdd.Enabled = false;
btSubmit.Enabled = false;
}
protected void ibDel_Click(object sender, EventArgs e)
{
if (this.hdLOCKFLAG.Value.Trim().Equals("1"))
{
Response.Write("<script>alert('业务已锁定,不允许删除!');history.back();</script>");
return;
}
//
string alt = CrmPriceCarrierDA.GetCrmPriceCarrierDel(Session["GID"].ToString().Trim(), strUserID.Trim());
if (alt != "")
{
Response.Write("<script>alert('" + alt + "');history.back();</script>");
return;
}
//
getEnabledTrue();
Session["strHandleType"] = "add";
this.hdHandle.Value = Session["strHandleType"].ToString().Trim();
//
getaddnull();
//
ibDel.Enabled = false;
ibAdd.Enabled = false;
ibFullAdd.Enabled = false;
btSubmit.Enabled = false;
}
public bool IsNumeric(string s)
{
bool bReturn = true;
try
{
int inum = int.Parse(s);
}
catch
{
int inum = 0;
bReturn = false;
}
return bReturn;
}
protected void btSubmit_Click(object sender, EventArgs e)
{
int iii = 0;
if (this.hdLOCKFLAG.Value.Trim().Equals("0"))
{
iii = CrmPriceCarrierDA.UpdateInfoCNTRTOTAL("update crm_price_carrier set LOCKFLAG='1' where GID='" + Session["GID"].ToString().Trim() + "'", strUserID.Trim());
if (iii == 1)
{
btSubmit.Text = "解锁";
this.hdLOCKFLAG.Value = "1";
getEnabled();
Page.ClientScript.RegisterStartupScript(this.GetType(), "key4", "<script>reloadParentSubmit('" + Session["GID"].ToString().Trim() + "');</script>");
return;
}
else
{
Response.Write("<script>alert('锁定出错!');</script>");
return;
}
}
else
{
iii = CrmPriceCarrierDA.UpdateInfoCNTRTOTAL("update crm_price_carrier set LOCKFLAG='0' where GID='" + Session["GID"].ToString().Trim() + "'", strUserID.Trim());
if (iii == 1)
{
btSubmit.Text = "锁定";
this.hdLOCKFLAG.Value = "0";
getEnabledTrue();
Page.ClientScript.RegisterStartupScript(this.GetType(), "key4", "<script>reloadParentSubmit('" + Session["GID"].ToString().Trim() + "');</script>");
return;
}
else
{
Response.Write("<script>alert('解锁出错!');</script>");
return;
}
}
}
}
}