Exemplo n.º 1
0
    private void ComboBoxBinding()
    {
        ControlBinder.CmbBinder(StoreServiceMode, "ServerMode", SYS[0].ToString());
        ControlBinder.CmbBinder(StoreUnit, "UnitBindingContainer", SYS[0].ToString());
        ControlBinder.CmbBinder(StoreDes, "Description", SYS[0].ToString());
        ControlBinder.CmbBinder(StoreCN, "ContainerSize", SYS[0].ToString());
        DataFactory dal = new DataFactory();
        DataSet     ds  = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_OceanExport_Container_SP", new List <IFields>()
        {
            dal.CreateIFields()
            .Append("Option", "GetContainerInfo").Append("oc_ToHBL", Request["HBL"])
        }).GetList();

        StoreCNNO.DataSource = ds;
        StoreCNNO.DataBind();
    }
Exemplo n.º 2
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        DataFactory dal = new DataFactory();

        DataTable dt = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_OceanExport_Container_SP", new List <IFields>()
        {
            dal.CreateIFields().Append("Option", "Update")
            .Append("oc_CtnrNo", txtContainer.Text.ToUpper().Trim())
            .Append("oc_CtnrSize", CmbSize.Value)
            .Append("oc_SealNo", txtSeal.Text.Trim().ToUpper())
            .Append("oc_Servicemode", CmbSerMode.Value)
            .Append("oc_SONo", txtSO.Text.Trim().ToUpper())
            .Append("oc_GWT", string.IsNullOrEmpty(txtGWT.Text)?DBNull.Value:(object)txtGWT.Text)
            .Append("oc_CBM", string.IsNullOrEmpty(txtCBM.Text)?DBNull.Value:(object)txtCBM.Text)
            .Append("oc_Piece", string.IsNullOrEmpty(txtPiece.Text)?DBNull.Value:(object)txtPiece.Text)
            .Append("oc_Unit", CmbUnit.Value)
            .Append("oc_OrderMarks", ControlBinder.GetMakeStr(txtMarks1.Text.TrimEnd().ToUpper(), 19))
            .Append("oc_OrderNoOfPackage", ControlBinder.GetMakeStr(txtmarks3.Text.TrimEnd().ToUpper(), 10))
            .Append("oc_OrderDescription", ControlBinder.GetMakeStr(txtMarks2.Text.TrimEnd().ToUpper(), 46))
            //.Append("oc_OrderDescription",txtMarks2.Text.TrimEnd().ToUpper().Replace("\r\n","\n"))
            .Append("oc_Remark", txtRemark.Text.ToUpper().Replace("\r\n", "\n"))
            .Append("oc_STAT", FSecurityHelper.CurrentUserDataGET()[12])
            .Append("oc_SYS", SYS)
            .Append("oc_User", FSecurityHelper.CurrentUserDataGET()[0])
            .Append("oc_ToHBL", hidHBL.Text)
            .Append("oc_ROWID", hidID.Text)
        }).GetTable();

        if (dt != null)
        {
            string rowID = dt.Rows[0][0].ToString();
            string flag  = dt.Rows[0][1].ToString();

            ControlBinder.pageTitleMsg(true, "OE-C:" + txtContainer.Text, "<p class=\"success\">Status : Record Saved with  <span>" + txtContainer.Text.ToUpper() + " </span> </p>", div_bottom);

            if (b)
            {
                b = false;
                X.Redirect("Container.aspx?HBL=" + Request["HBL"]);
            }

            if (flag.Trim() == "Insert")
            {
                X.Redirect("Container.aspx?ID=" + rowID + "&HBL=" + Request["HBL"]);
            }
            else
            {
                DataSet ds = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_OceanExport_Container_SP", new List <IFields>()
                {
                    dal.CreateIFields()
                    .Append("Option", "GetContainerInfo").Append("oc_ToHBL", Request["HBL"])
                }).GetList();
                StoreCNNO.DataSource = ds;
                StoreCNNO.DataBind();
            }

            lblPiece.Text = txtPiece.Text;
            //lblUnit.Text = CmbUnit.Value;
            X.AddScript("var r = StoreUnit.getById($('#CmbUnit').val());#{lblUnit}.setValue(r.data.short);");
        }
        else
        {
            ControlBinder.pageTitleMsg(false, "OE-C:" + txtContainer.Text.ToUpper(), "<p class=\"error\">Status : Save failed, please check the data . </p>", div_bottom);
        }
    }