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.
D7QUANTAI/DSWeb/Shipping/SeaExportInfoBillOfLadingAd...

705 lines
36 KiB
C#

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;
namespace DSWeb.Shipping
{
public partial class SeaExportInfoBillOfLadingAdd : System.Web.UI.Page
{
public string sSQL = String.Empty;
public string gvid = String.Empty;
T_ALL_DA T_ALL_DA = new T_ALL_DA();
MoneyConvert MoneyConvert = new MoneyConvert();
TopSeaeEntity TopSeaeEntity = new TopSeaeEntity();
SeaExportInfoDA SeaExportInfoDA = new SeaExportInfoDA();
TopSeaeBillmanageEntity TopSeaeBillmanageEntity = new TopSeaeBillmanageEntity();
TopSeaeBillmanageDA TopSeaeBillmanageDA = new TopSeaeBillmanageDA();
RangeDA RangeDA = new RangeDA();
public string strUserID;//用户GID
protected void Page_Load(object sender, EventArgs e)
{
if (Session["USERID"] != null)
{
strUserID = Session["USERID"].ToString().Trim();
}
else
{
Server.Transfer("~/Error/FriendError.aspx");
return;
//strUserID = "";
}
//
if (!IsPostBack)
{
if (Request.QueryString["id"] != null)
{
ViewState["GID"] = Request.QueryString["id"].ToString();
}
if (Request.QueryString["BILLTYPE"] != null)
{
if (Request.QueryString["BILLTYPE"].Trim().Equals("0"))
{
ViewState["BILLTYPE"] = "主单";
}
else if(Request.QueryString["BILLTYPE"].Trim().Equals("1"))
{
ViewState["BILLTYPE"] = "分单";
}
}
if (Request.QueryString["TEMPLATE"] != null)
{
ViewState["TEMPLATE"] = Request.QueryString["TEMPLATE"].ToString();
TopSeaeEntity = SeaExportInfoDA.GetID(ViewState["GID"].ToString().Trim());
this.hd_comboCUSTOMERNAME.Value = TopSeaeEntity.CUSTOMERNAME.ToString().Trim();
this.hd_comboCUSTOMERCODE.Value = T_ALL_DA.GetStrSQL("CODENAME", "select top 1 CODENAME from info_client where SHORTNAME='" + this.hd_comboCUSTOMERNAME.Value.Trim() + "'");
}
if (Request.QueryString["strIS"] != null)
{
ViewState["strIS"] = Request.QueryString["strIS"].ToString();
}
if (Request.QueryString["asid"] != null)
{
Session["asid"] = Request.QueryString["asid"].ToString();
this.hdGid.Value= Request.QueryString["asid"].ToString();
}
//
if (Request.QueryString["handle"] != "edit")
{
Session["handle"] = Request.QueryString["handle"].ToString();
TopSeaeEntity = SeaExportInfoDA.GetID(ViewState["GID"].ToString().Trim());
if (TopSeaeEntity.BSNO != null)
{
DataSet ds = T_ALL_DA.GetTSysTemplateSet(ViewState["TEMPLATE"].ToString().Trim());
if (ds != null)
{
tbMBLNO.Text = TopSeaeEntity.MBLNO.ToString().Trim();
tbHBLNO.Text = TopSeaeEntity.HBLNO.ToString().Trim();
if (ViewState["strIS"].ToString().Trim().Equals("true"))
{
tbSHIPPER.Text = TopSeaeEntity.SHIPPER.ToString().Trim();
tbCONSIGNEE.Text = TopSeaeEntity.CONSIGNEE.ToString().Trim();
tbNOTIFYPARTY.Text = TopSeaeEntity.NOTIFYPARTY.ToString().Trim();
}
tbAGENT.Text = TopSeaeEntity.AGENT.ToString().Trim();
ddlVESSEL.Text = TopSeaeEntity.VESSEL.ToString().Trim();
ddlVOYNO.Text = TopSeaeEntity.VOYNO.ToString().Trim();
//
if (TopSeaeEntity.ISSUEDATE.ToString().Trim().IndexOf("0001")>-1)
{
tbISSUEDATE.Text = "";
}
else
{
tbISSUEDATE.Text = TopSeaeEntity.ISSUEDATE.ToString("yyyy-MM-dd").Trim();
}
//
ddlPORTLOAD.Text = TopSeaeEntity.PORTLOAD.ToString().Trim();
ddlPORTDISCHARGE.Text = TopSeaeEntity.PORTDISCHARGE.ToString().Trim();
ddlPLACEDELIVERY.Text = TopSeaeEntity.PLACEDELIVERY.ToString().Trim();
ddlDESTINATION.Text = TopSeaeEntity.DESTINATION.ToString().Trim();
ddlNOBILL.Text = TopSeaeEntity.NOBILL.ToString().Trim();
tbISSUEPLACE.Text = TopSeaeEntity.ISSUEPLACE.ToString().Trim();
//
DataSet dss = SeaExportInfoDA.GetFieldAll(ViewState["GID"].ToString().Trim());
if (dss != null)
{
ArrayList strB = new ArrayList();
ArrayList strC = new ArrayList();
if (ds.Tables[0].Rows[0]["MARKS_SET"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["MARKS_SET"].ToString().Trim() != null)
{
tbMARKS.Text = "";
string[] strA = ds.Tables[0].Rows[0]["MARKS_SET"].ToString().Trim().Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
for (int i = 0; i < strA.Length; i++)
{
string ls = strA[i].ToString().Trim();
for (int s = 0; s < ls.Length; s++)
{
if (ls.Substring(s,1).Equals("["))
{
strB.Add(s);
}
else if (ls.Substring(s,1).Equals("]"))
{
strC.Add(s+1);
}
}
for (int t = 0; t < strB.Count; t++)
{
string s1 = ls.Trim().Substring(int.Parse(strB[t].ToString().Trim()), int.Parse(strC[t].ToString().Trim()));
string s2 = ls.Trim().Substring(int.Parse(strB[t].ToString().Trim())+1, int.Parse(strC[t].ToString().Trim())-2);
try
{
ls = ls.Trim().Replace(s1, dss.Tables[0].Rows[0][s2].ToString().Trim());
}
catch
{
}
}
strB.Clear();
strC.Clear();
//
/*
string strF = "";
try
{
strF = dss.Tables[0].Rows[0][ls].ToString().Trim() + "\n";
}
catch
{
strF = ls + "\n";
}
*/
if (ls.Trim() != "")
{
ls = ls + "\n";
}
tbMARKS.Text += ls;
}
}
else
{
tbMARKS.Text = TopSeaeEntity.MARKS.ToString().Trim();
}
//
if (ds.Tables[0].Rows[0]["DESCRIPTION_SETS"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["DESCRIPTION_SETS"].ToString().Trim() != null)
{
tbDESCRIPTION.Text = "";
string[] strA = ds.Tables[0].Rows[0]["DESCRIPTION_SETS"].ToString().Trim().Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
for (int i = 0; i < strA.Length; i++)
{
string ls = strA[i].ToString().Trim();
for (int s = 0; s < ls.Length; s++)
{
if (ls.Substring(s, 1).Equals("["))
{
strB.Add(s);
}
else if (ls.Substring(s, 1).Equals("]"))
{
strC.Add(s + 1);
}
}
for (int t = 0; t < strB.Count; t++)
{
string s1 = ls.Trim().Substring(int.Parse(strB[t].ToString().Trim()), int.Parse(strC[t].ToString().Trim()));
string s2 = ls.Trim().Substring(int.Parse(strB[t].ToString().Trim()) + 1, int.Parse(strC[t].ToString().Trim()) - 2);
try
{
ls = ls.Trim().Replace(s1, dss.Tables[0].Rows[0][s2].ToString().Trim());
}
catch
{
}
}
strB.Clear();
strC.Clear();
//
/*
string strF = "";
try
{
strF = dss.Tables[0].Rows[0][ls].ToString().Trim() + "\n";
}
catch
{
strF = ls + "\n";
}
*/
if (ls.Trim() != "")
{
ls = ls + "\n";
}
tbDESCRIPTION.Text += ls;
}
}
else
{
tbDESCRIPTION.Text = TopSeaeEntity.DESCRIPTION.ToString().Trim();
}
}
else
{
tbMARKS.Text = TopSeaeEntity.MARKS.ToString().Trim();
tbDESCRIPTION.Text = TopSeaeEntity.DESCRIPTION.ToString().Trim();
}
//
tbCNTRSEALNO.Text = "";// TopSeaeEntity.CNTRSEALNO.ToString().Trim();
//获取委托相关的集装箱信息
IList<TopCtnEntity> topCtnEntities = new List<TopCtnEntity>();
TopCtnDA topCtnDA = new TopCtnDA();
topCtnEntities = topCtnDA.GetID(TopSeaeEntity.BSNO.ToString().Trim());
if (topCtnEntities.Count > 0)
{
foreach (TopCtnEntity ctnEntity in topCtnEntities)
{
tbCNTRSEALNO.Text += ctnEntity.CNTRNO.ToString().Trim() + "/" + ctnEntity.SEALNO.ToString().Trim() + "/" + ctnEntity.CTNALL.ToString().Trim() + "\r\n";
}
}
//
tbNOPKGS.Text = TopSeaeEntity.PKGS.ToString().Trim() + TopSeaeEntity.KINDPKGS.ToString().Trim();
//
if (ds.Tables[0].Rows[0]["KGS_DIGITAL"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["KGS_DIGITAL"].ToString().Trim() != null)
{
string x = "#.";
int iKGS = int.Parse(ds.Tables[0].Rows[0]["KGS_DIGITAL"].ToString().Trim());
for (int i = 0; i < iKGS; i++)
{
x += "#";
}
tbGROSSWEIGHT.Text = TopSeaeEntity.KGS.ToString(x).Trim();
}
else
{
tbGROSSWEIGHT.Text = TopSeaeEntity.KGS.ToString().Trim();
}
//
if (ds.Tables[0].Rows[0]["CBM_DIGITAL"].ToString().Trim() != "" && ds.Tables[0].Rows[0]["CBM_DIGITAL"].ToString().Trim() != null)
{
string x = "#.";
int iCBM = int.Parse(ds.Tables[0].Rows[0]["CBM_DIGITAL"].ToString().Trim());
for (int i = 0; i < iCBM; i++)
{
x += "#";
}
tbMEASUREMENT.Text = TopSeaeEntity.CBM.ToString(x).Trim();
}
else
{
tbMEASUREMENT.Text = TopSeaeEntity.CBM.ToString().Trim();
}
//
tbTOTALNO.Text = TopSeaeEntity.TOTALNO.ToString().Trim();
}
else
{
tbMBLNO.Text = TopSeaeEntity.MBLNO.ToString().Trim();
tbHBLNO.Text = TopSeaeEntity.HBLNO.ToString().Trim();
if (ViewState["strIS"].ToString().Trim().Equals("true"))
{
tbSHIPPER.Text = TopSeaeEntity.SHIPPER.ToString().Trim();
tbCONSIGNEE.Text = TopSeaeEntity.CONSIGNEE.ToString().Trim();
tbNOTIFYPARTY.Text = TopSeaeEntity.NOTIFYPARTY.ToString().Trim();
}
tbAGENT.Text = TopSeaeEntity.AGENT.ToString().Trim();
ddlVESSEL.Text = TopSeaeEntity.VESSEL.ToString().Trim();
ddlVOYNO.Text = TopSeaeEntity.VOYNO.ToString().Trim();
//
if (TopSeaeEntity.ISSUEDATE.ToString().Trim().IndexOf("0001")>-1)
{
tbISSUEDATE.Text = "";
}
else
{
tbISSUEDATE.Text = TopSeaeEntity.ISSUEDATE.ToString("yyyy-MM-dd").Trim();
}
//
ddlPORTLOAD.Text = TopSeaeEntity.PORTLOAD.ToString().Trim();
ddlPORTDISCHARGE.Text = TopSeaeEntity.PORTDISCHARGE.ToString().Trim();
ddlPLACEDELIVERY.Text = TopSeaeEntity.PLACEDELIVERY.ToString().Trim();
ddlDESTINATION.Text = TopSeaeEntity.DESTINATION.ToString().Trim();
ddlNOBILL.Text = TopSeaeEntity.NOBILL.ToString().Trim();
tbISSUEPLACE.Text = TopSeaeEntity.ISSUEPLACE.ToString().Trim();
tbMARKS.Text = TopSeaeEntity.MARKS.ToString().Trim();
tbDESCRIPTION.Text = TopSeaeEntity.DESCRIPTION.ToString().Trim();
//
tbCNTRSEALNO.Text = "";// TopSeaeEntity.CNTRSEALNO.ToString().Trim();
//获取委托相关的集装箱信息
IList<TopCtnEntity> topCtnEntities = new List<TopCtnEntity>();
TopCtnDA topCtnDA = new TopCtnDA();
topCtnEntities = topCtnDA.GetID(TopSeaeEntity.BSNO.ToString().Trim());
if (topCtnEntities.Count > 0)
{
foreach (TopCtnEntity ctnEntity in topCtnEntities)
{
tbCNTRSEALNO.Text += ctnEntity.CNTRNO.ToString().Trim() + "/" + ctnEntity.SEALNO.ToString().Trim() + "/" + ctnEntity.CTNALL.ToString().Trim() + "\r\n";
}
}
//
tbNOPKGS.Text = TopSeaeEntity.PKGS.ToString().Trim() + TopSeaeEntity.KINDPKGS.ToString().Trim();
//
tbGROSSWEIGHT.Text = TopSeaeEntity.KGS.ToString().Trim();
tbMEASUREMENT.Text = TopSeaeEntity.CBM.ToString().Trim();
tbTOTALNO.Text = TopSeaeEntity.TOTALNO.ToString().Trim();
}
}
else
{
}
//
this.imgPrint.Disabled = true;
}
else
{
Session["handle"] = Request.QueryString["handle"].ToString();
if (Session["asid"] != null && Session["asid"].ToString().Trim() != "")
{
TopSeaeBillmanageEntity = TopSeaeBillmanageDA.GetID(Session["asid"].ToString().Trim());
if (TopSeaeBillmanageEntity.AS_ID != null)
{
ViewState["TEMPLATE"] = TopSeaeBillmanageEntity.TEMPLATE;
ViewState["BILLTYPE"] = TopSeaeBillmanageEntity.BILLTYPE;
tbMBLNO.Text = TopSeaeBillmanageEntity.MBLNO.ToString().Trim();
tbHBLNO.Text = TopSeaeBillmanageEntity.HBLNO.ToString().Trim();
tbSHIPPER.Text = TopSeaeBillmanageEntity.SHIPPER.ToString().Trim();
tbCONSIGNEE.Text = TopSeaeBillmanageEntity.CONSIGNEE.ToString().Trim();
tbNOTIFYPARTY.Text = TopSeaeBillmanageEntity.NOTIFYPARTY.ToString().Trim();
tbAGENT.Text = TopSeaeBillmanageEntity.AGENT.ToString().Trim();
ddlVESSEL.Text = TopSeaeBillmanageEntity.VESSEL.ToString().Trim();
ddlVOYNO.Text = TopSeaeBillmanageEntity.VOYNO.ToString().Trim();
//
if (TopSeaeBillmanageEntity.ISSUEDATE.ToString().Trim().IndexOf("0001")>-1)
{
tbISSUEDATE.Text = "";
}
else
{
tbISSUEDATE.Text = TopSeaeEntity.ISSUEDATE.ToString("yyyy-MM-dd").Trim();
}
//
ddlPORTLOAD.Text = TopSeaeBillmanageEntity.PORTLOAD.ToString().Trim();
ddlPORTDISCHARGE.Text = TopSeaeBillmanageEntity.PORTDISCHARGE.ToString().Trim();
ddlPLACEDELIVERY.Text = TopSeaeBillmanageEntity.PLACEDELIVERY.ToString().Trim();
ddlDESTINATION.Text = TopSeaeBillmanageEntity.DESTINATION.ToString().Trim();
ddlNOBILL.Text = TopSeaeBillmanageEntity.NOBILL.ToString().Trim();
tbISSUEPLACE.Text = TopSeaeBillmanageEntity.ISSUEPLACE.ToString().Trim();
tbMARKS.Text = TopSeaeBillmanageEntity.MARKS.ToString().Trim();
tbDESCRIPTION.Text = TopSeaeBillmanageEntity.DESCRIPTION.ToString().Trim();
tbCNTRSEALNO.Text = TopSeaeBillmanageEntity.CNTRSEALNO.ToString().Trim();
tbGROSSWEIGHT.Text = TopSeaeBillmanageEntity.GROSSWEIGHT.ToString().Trim();
tbMEASUREMENT.Text = TopSeaeBillmanageEntity.MEASUREMENT.ToString().Trim();
tbTOTALNO.Text = TopSeaeBillmanageEntity.TOTALNO.ToString().Trim();
//
tbNOPKGS.Text = TopSeaeBillmanageEntity.NOPKGS.ToString().Trim();
}
else
{
}
}
//权限可视范围
string strV = RangeDA.GetVISIBLERANGE(strUserID.Trim(), "modOrderManagement");
string strO = RangeDA.GetOPERATERANGE(strUserID.Trim(), "modOrderManagement");
//页面是否只读
if (Request.QueryString["hdenabled"] != null)
{
this.hdEnabled.Value = Request.QueryString["hdenabled"].ToString();
if (Request.QueryString["hdenabled"].ToString() == "false")
{
strO = "4";
}
}
//
string alt = "";
if (strV.Trim() != strO.Trim())
{
if (strO.Trim().Equals("0"))//全部
{
}
else if (strO.Trim().Equals("1"))//分公司
{
alt = RangeDA.GetOrderManagementCompany(strUserID.Trim(), ViewState["GID"].ToString().Trim());
if (alt == "")
{
getEnabled();
}
}
else if (strO.Trim().Equals("2"))//部门
{
alt = RangeDA.GetOrderManagementDEPT(strUserID.Trim(), ViewState["GID"].ToString().Trim());
if (alt == "")
{
getEnabled();
}
}
else if (strO.Trim().Equals("3"))//个人
{
alt = RangeDA.GetOrderManagementPerson(strUserID.Trim(), ViewState["GID"].ToString().Trim());
if (alt == "")
{
getEnabled();
}
}
else if (strO.Trim().Equals("4"))//无
{
getEnabled();
}
}
//
}
}
//加载下拉框
Page.ClientScript.RegisterStartupScript(this.GetType(), "key0", "<script>initComboSHIPPERID();initComboCONSIGNEEID();initComboNOTIFYPARTYID();initComboAGENTID();</script>");
}
protected void getEnabled()
{
ibEnter.Enabled = false;
this.imgPrint.Disabled = true;
//
tbMBLNO.Enabled = false;
tbHBLNO.Enabled = false;
tbSHIPPER.Enabled = false;
tbCONSIGNEE.Enabled = false;
tbNOTIFYPARTY.Enabled = false;
tbAGENT.Enabled = false;
ddlVESSEL.Enabled = false;
ddlVOYNO.Enabled = false;
ddlPORTLOAD.Enabled = false;
ddlPORTDISCHARGE.Enabled = false;
ddlDESTINATION.Enabled = false;
ddlPLACEDELIVERY.Enabled = false;
tbCNTRSEALNO.Enabled = false;
tbMARKS.Enabled = false;
tbNOPKGS.Enabled = false;
tbDESCRIPTION.Enabled = false;
tbGROSSWEIGHT.Enabled = false;
tbMEASUREMENT.Enabled = false;
tbTOTALNO.Enabled = false;
tbISSUEDATE.Enabled = false;
tbISSUEPLACE.Enabled = false;
ddlNOBILL.Enabled = false;
}
protected void btnEnter_Click(object sender, ImageClickEventArgs e)
{
if (Session["handle"].ToString().Trim() != "edit")
{
bool bl = getAdd();
if (bl)
{
this.imgPrint.Disabled = false;
Session["handle"] = "edit";
Page.ClientScript.RegisterStartupScript(this.GetType(), "key", "<script>reloadParent('" + ViewState["GID"].ToString().Trim() + "','" + Session["asid"].ToString().Trim() + "');</script>");
//System.Web.UI.ScriptManager.RegisterStartupScript(this.UpdatePanel3, this.GetType(), "unReport30", "alert('成功提交!');window.opener.location.reload();history.back();", true);
return;
}
else
{
System.Web.UI.ScriptManager.RegisterStartupScript(this.UpdatePanel3, this.GetType(), "unReport31", "alert('出错,请重新填写!');", true);
return;
}
}
else
{
if (Session["asid"] != null && Session["asid"].ToString().Trim() != "")
{
bool bl = getEdit();
if (bl)
{
System.Web.UI.ScriptManager.RegisterStartupScript(this.UpdatePanel3, this.GetType(), "unReport30", "alert('成功提交!');window.opener.location.reload();history.back();", true);
return;
}
else
{
System.Web.UI.ScriptManager.RegisterStartupScript(this.UpdatePanel3, this.GetType(), "unReport31", "alert('出错,请重新填写!');", true);
return;
}
}
}
}
protected bool getAdd()
{
TopSeaeBillmanageEntity.ETA = DateTime.Parse("0001-1-1 0:00:00");
TopSeaeBillmanageEntity.ETD = DateTime.Parse("0001-1-1 0:00:00");
TopSeaeBillmanageEntity.CLOSINGDATE = DateTime.Parse("0001-1-1 0:00:00");
TopSeaeBillmanageEntity.ISSUEDATE = DateTime.Parse("0001-1-1 0:00:00");
//
Session["asid"] = T_ALL_DA.getSQLID("OpSeaeBillmanage");
TopSeaeBillmanageEntity.AS_ID = Session["asid"].ToString().Trim();
TopSeaeBillmanageEntity.BSNO = ViewState["GID"].ToString().Trim();
TopSeaeBillmanageEntity.MBLNO = tbMBLNO.Text.Trim();
TopSeaeBillmanageEntity.HBLNO = tbHBLNO.Text.Trim();
if (ViewState["TEMPLATE"] != null)
{
TopSeaeBillmanageEntity.TEMPLATE = ViewState["TEMPLATE"].ToString().Trim();
}
if (ViewState["BILLTYPE"] != null)
{
TopSeaeBillmanageEntity.BILLTYPE = ViewState["BILLTYPE"].ToString().Trim();
}
TopSeaeBillmanageEntity.SHIPPERID = "";
TopSeaeBillmanageEntity.CONSIGNEEID = "";
TopSeaeBillmanageEntity.NOTIFYPARTYID = "";
TopSeaeBillmanageEntity.AGENTID = "";
TopSeaeBillmanageEntity.SHIPPER = tbSHIPPER.Text.Trim();
TopSeaeBillmanageEntity.CONSIGNEE = tbCONSIGNEE.Text.Trim();
TopSeaeBillmanageEntity.NOTIFYPARTY = tbNOTIFYPARTY.Text.Trim();
TopSeaeBillmanageEntity.AGENT = tbAGENT.Text.Trim();
TopSeaeBillmanageEntity.YARD = "";
TopSeaeBillmanageEntity.VESSEL = ddlVESSEL.Text.Trim();
TopSeaeBillmanageEntity.VOYNO = ddlVOYNO.Text.Trim();
if (tbISSUEDATE.Text.Trim() != "")
{
TopSeaeBillmanageEntity.ISSUEDATE = DateTime.Parse(tbISSUEDATE.Text.Trim());
}
TopSeaeBillmanageEntity.PlACERECEIPT = "";
TopSeaeBillmanageEntity.PORTLOADID = "";
TopSeaeBillmanageEntity.PORTDISCHARGEID = "";
TopSeaeBillmanageEntity.PLACEDELIVERYID = "";
TopSeaeBillmanageEntity.DESTINATIONID = "";
TopSeaeBillmanageEntity.PORTLOAD = ddlPORTLOAD.Text.Trim();
TopSeaeBillmanageEntity.PORTDISCHARGE = ddlPORTDISCHARGE.Text.Trim();
TopSeaeBillmanageEntity.PLACEDELIVERY = ddlPLACEDELIVERY.Text.Trim();
TopSeaeBillmanageEntity.DESTINATION = ddlDESTINATION.Text.Trim();
TopSeaeBillmanageEntity.NOBILL = ddlNOBILL.Text.Trim();
TopSeaeBillmanageEntity.ISSUETYPE = "";
TopSeaeBillmanageEntity.ISSUEPLACE = tbISSUEPLACE.Text.Trim();
TopSeaeBillmanageEntity.BLFRT = "";
TopSeaeBillmanageEntity.PREPARDAT = "";
TopSeaeBillmanageEntity.PAYABLEAT = "";
TopSeaeBillmanageEntity.SERVICE = "";
TopSeaeBillmanageEntity.MARKS = tbMARKS.Text.Trim();
TopSeaeBillmanageEntity.CNTRSEALNO = tbCNTRSEALNO.Text.Trim();
TopSeaeBillmanageEntity.NOPKGS = tbNOPKGS.Text.Trim();
TopSeaeBillmanageEntity.DESCRIPTION = tbDESCRIPTION.Text.Trim();
TopSeaeBillmanageEntity.GOODSNAME = "";
TopSeaeBillmanageEntity.GROSSWEIGHT = tbGROSSWEIGHT.Text.Trim();
TopSeaeBillmanageEntity.MEASUREMENT = tbMEASUREMENT.Text.Trim();
TopSeaeBillmanageEntity.PKGS = 0;
TopSeaeBillmanageEntity.KINDPKGS = "";
TopSeaeBillmanageEntity.KGS = 0;
TopSeaeBillmanageEntity.CBM = 0;
TopSeaeBillmanageEntity.TOTALNO = tbTOTALNO.Text.Trim();
TopSeaeBillmanageEntity.CNTRNO = "";
TopSeaeBillmanageEntity.CNTRTOTAL = "";
TopSeaeBillmanageEntity.INPUTBY = "";
//
int iResult = TopSeaeBillmanageDA.InserInfo(TopSeaeBillmanageEntity);
if (iResult > 0)
{
return true;
}
else
{
return false;
}
}
protected bool getEdit()
{
TopSeaeBillmanageEntity.ETA = DateTime.Parse("0001-1-1 0:00:00");
TopSeaeBillmanageEntity.ETD = DateTime.Parse("0001-1-1 0:00:00");
TopSeaeBillmanageEntity.CLOSINGDATE = DateTime.Parse("0001-1-1 0:00:00");
TopSeaeBillmanageEntity.ISSUEDATE = DateTime.Parse("0001-1-1 0:00:00");
//
TopSeaeBillmanageEntity.AS_ID = Session["asid"].ToString().Trim();
TopSeaeBillmanageEntity.BSNO = ViewState["GID"].ToString().Trim();
TopSeaeBillmanageEntity.MBLNO = tbMBLNO.Text.Trim();
TopSeaeBillmanageEntity.HBLNO = tbHBLNO.Text.Trim();
if (ViewState["TEMPLATE"] != null)
{
TopSeaeBillmanageEntity.TEMPLATE = ViewState["TEMPLATE"].ToString().Trim();
}
if (ViewState["BILLTYPE"] != null)
{
TopSeaeBillmanageEntity.BILLTYPE = ViewState["BILLTYPE"].ToString().Trim();
}
TopSeaeBillmanageEntity.SHIPPERID = "";
TopSeaeBillmanageEntity.CONSIGNEEID = "";
TopSeaeBillmanageEntity.NOTIFYPARTYID = "";
TopSeaeBillmanageEntity.AGENTID = "";
TopSeaeBillmanageEntity.SHIPPER = tbSHIPPER.Text.Trim();
TopSeaeBillmanageEntity.CONSIGNEE = tbCONSIGNEE.Text.Trim();
TopSeaeBillmanageEntity.NOTIFYPARTY = tbNOTIFYPARTY.Text.Trim();
TopSeaeBillmanageEntity.AGENT = tbAGENT.Text.Trim();
TopSeaeBillmanageEntity.YARD = "";
TopSeaeBillmanageEntity.VESSEL = ddlVESSEL.Text.Trim();
TopSeaeBillmanageEntity.VOYNO = ddlVOYNO.Text.Trim();
if (tbISSUEDATE.Text.Trim() != "")
{
TopSeaeBillmanageEntity.ISSUEDATE = DateTime.Parse(tbISSUEDATE.Text.Trim());
}
TopSeaeBillmanageEntity.PlACERECEIPT = "";
TopSeaeBillmanageEntity.PORTLOADID = "";
TopSeaeBillmanageEntity.PORTDISCHARGEID = "";
TopSeaeBillmanageEntity.PLACEDELIVERYID = "";
TopSeaeBillmanageEntity.DESTINATIONID = "";
TopSeaeBillmanageEntity.PORTLOAD = ddlPORTLOAD.Text.Trim();
TopSeaeBillmanageEntity.PORTDISCHARGE = ddlPORTDISCHARGE.Text.Trim();
TopSeaeBillmanageEntity.PLACEDELIVERY = ddlPLACEDELIVERY.Text.Trim();
TopSeaeBillmanageEntity.DESTINATION = ddlDESTINATION.Text.Trim();
TopSeaeBillmanageEntity.NOBILL = ddlNOBILL.Text.Trim();
TopSeaeBillmanageEntity.ISSUETYPE = "";
TopSeaeBillmanageEntity.ISSUEPLACE = tbISSUEPLACE.Text.Trim();
TopSeaeBillmanageEntity.BLFRT = "";
TopSeaeBillmanageEntity.PREPARDAT = "";
TopSeaeBillmanageEntity.PAYABLEAT = "";
TopSeaeBillmanageEntity.SERVICE = "";
TopSeaeBillmanageEntity.MARKS = tbMARKS.Text.Trim();
TopSeaeBillmanageEntity.CNTRSEALNO = tbCNTRSEALNO.Text.Trim();
TopSeaeBillmanageEntity.NOPKGS = tbNOPKGS.Text.Trim();
TopSeaeBillmanageEntity.DESCRIPTION = tbDESCRIPTION.Text.Trim();
TopSeaeBillmanageEntity.GOODSNAME = "";
TopSeaeBillmanageEntity.GROSSWEIGHT = tbGROSSWEIGHT.Text.Trim();
TopSeaeBillmanageEntity.MEASUREMENT = tbMEASUREMENT.Text.Trim();
TopSeaeBillmanageEntity.PKGS = 0;
TopSeaeBillmanageEntity.KINDPKGS = "";
TopSeaeBillmanageEntity.KGS = 0;
TopSeaeBillmanageEntity.CBM = 0;
TopSeaeBillmanageEntity.TOTALNO = tbTOTALNO.Text.Trim();
TopSeaeBillmanageEntity.CNTRNO = "";
TopSeaeBillmanageEntity.CNTRTOTAL = "";
TopSeaeBillmanageEntity.INPUTBY = "";
//
int iResult = TopSeaeBillmanageDA.UpdateInfo(TopSeaeBillmanageEntity);
if (iResult > 0)
{
return true;
}
else
{
return false;
}
}
public bool IsNumeric(string s)
{
int inum = 0;
bool bReturn = true;
try
{
inum = int.Parse(s);
}
catch
{
inum = 0;
bReturn = false;
}
return bReturn;
}
//
}
}