예제 #1
0
    protected void btnSave_click(object sender, DirectEventArgs e)
    {
        string strStat = "";

        for (int i = 0; i < tblChkGroup.Items.Count(); ++i)
        {
            if (!tblChkGroup.Items[i].Checked)
            {
                strStat += tblChkGroup.Items[i].Tag.Trim() + ",";
            }
        }
        strStat = strStat.Length > 0 ? strStat.Substring(0, strStat.Length - 1) : strStat;

        if (Code.Text.Trim() == "")
        {
            div_bottom.Html = "<p class=\"error\">Status : Saved failed , code can't be empty! </p>";
            Code.Focus();
            return;
        }
        else if (BaseCheckCode.Check("AIRLINE", Code.Text.ToUpper().Trim(), "", hidRowID.Text) == "N")
        {
            Code.Focus(true);
            div_bottom.Html = "<p class=\"error\">Status : Saved failed ,the code already exists! </p>";
            return;
        }

        DataFactory dal = new DataFactory();

        bool bFlag = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_BasicData_Airline_SP", new List <IFields>()
        {
            dal.CreateIFields().Append("Option", "Update")
            .Append("User", FSecurityHelper.CurrentUserDataGET()[0])
            .Append("SYS", Request["sys"])
            .Append("dept", FSecurityHelper.CurrentUserDataGET()[28].ToUpper())
            .Append("STAT", FSecurityHelper.CurrentUserDataGET()[12])
            .Append("Code", Code.Text.ToUpper().Trim())
            .Append("Name", Name.Text.ToUpper().Trim())
            .Append("Country", Country.Value)
            .Append("CallSign", txtCallSign.Text.ToUpper().Trim())
            .Append("Active", chkActive.Checked?"1":"0")
            .Append("ROWID", hidRowID.Text)
            .Append("statstr", strStat)
        }).Update();

        if (bFlag)
        {
            if (!string.IsNullOrEmpty(Request["control"]))
            {
                X.AddScript("window.parent.ChildCallBack(Request(\"control\"), $(\"#Code\").val());");
                return;
            }

            if (i == 1)
            {
                hidRowID.Text    = "0";
                Code.Text        = "";
                Name.Text        = "";
                Country.Text     = "";
                txtCallSign.Text = "";
                Code.Disabled    = false;
                CheckGroupChecked();
            }
            else
            {
                Code.Disabled = true;
                hidRowID.Text = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_BasicData_Airline_SP", new List <IFields>()
                {
                    dal.CreateIFields().Append("Option", "List")
                    .Append("STAT", FSecurityHelper.CurrentUserDataGET()[12])
                    .Append("dept", FSecurityHelper.CurrentUserDataGET()[28].ToUpper())
                    .Append("Code", Code.Text.ToUpper().Trim())
                    .Append("isGetId", 1)
                }).GetTable().Rows[0][0].ToString();
            }

            div_bottom.Html = "<p class='success'>Status: Saved successful . </p>";
        }
        else
        {
            div_bottom.Html = "<p class='error'>Status: Saved failed , please check the data ! </p>";
        }

        this.BindData();
        Code.Focus(true);
    }
예제 #2
0
    /// <summary>
    /// 修改时间2014-09-20 Grace
    /// </summary>
    public void btnSave_Click(object sender, DirectEventArgs e)
    {
        string strStat = "";

        for (int i = 0; i < tblChkGroup.Items.Count(); ++i)
        {
            if (!tblChkGroup.Items[i].Checked)
            {
                strStat += tblChkGroup.Items[i].Tag.Trim() + ",";
            }
        }

        strStat = strStat.Length > 0 ? strStat.Substring(0, strStat.Length - 1) : strStat;

        if (string.IsNullOrEmpty(Code.Text))
        {
            Code.Focus(true);
            div_bottom.Html = "<p class=\"error\">Status : Saved failed , code can't be empty ! </p>";
            return;
        }

        if (BaseCheckCode.Check("SALESMAN", Code.Text.ToUpper().Trim(), sys, hidRowID.Text) == "N")
        {
            Code.Focus(true);
            div_bottom.Html = "<p class=\"error\">Status : Saved failed ,the code already exists ! </p>";
            return;
        }

        DataTable dt = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_BasicData_Sales_SP", new List <IFields>()
        {
            dal.CreateIFields().Append("Option", "Update")
            .Append("User", FSecurityHelper.CurrentUserDataGET()[0])
            .Append("SYS", DBNull.Value)
            .Append("dept", FSecurityHelper.CurrentUserDataGET()[28].ToUpper())
            .Append("STAT", FSecurityHelper.CurrentUserDataGET()[12])
            .Append("Code", Code.Text.ToUpper().Trim())
            .Append("Name", Name.Text.ToUpper().Trim())
            .Append("Company", Company.Value)
            .Append("USGroup", chkUSGroup.Checked?"1":"0")
            .Append("Active", chkActive.Checked?"1":"0")
            .Append("ROWID", hidRowID.Text)
            .Append("statstr", strStat)
        }).GetTable();

        if (dt != null && dt.Rows.Count > 0)
        {
            hidRowID.Text = dt.Rows[0][0].ToString();
            if (!string.IsNullOrEmpty(Request["control"]))
            {
                X.AddScript("window.parent.ChildCallBack(Request(\"control\"), $(\"#Code\").val());");
                return;
            }
            if (i == 1)
            {
                InitCotrol();
                Code.Disabled = false;
                CheckGroupChecked();
            }
            else
            {
                Code.Disabled = true;
                hidRowID.Text = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_BasicData_Sales_SP", new List <IFields>()
                {
                    dal.CreateIFields().Append("Option", "List")
                    .Append("STAT", FSecurityHelper.CurrentUserDataGET()[12])
                    .Append("dept", FSecurityHelper.CurrentUserDataGET()[28].ToUpper())
                    .Append("SYS", sys)
                    .Append("Code", Code.Text.Trim())
                    .Append("isGetId", 1)
                }).GetTable().Rows[0][0].ToString();
            }
            //X.Msg.Alert("Status", " saved successful ! ").Show();
            div_bottom.Html = "<p class='success'>Status: Saved successful . </p>";
        }
        else
        {
            div_bottom.Html = "<p class='error'>Status: Saved failed , please check the data ! </p>";
        }

        //X.Msg.Alert("Status", " Error, saved failed ! ").Show();

        Code.Focus(true);
        this.BindData();
    }
예제 #3
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        string strStat = "";

        for (int i = 0; i < tblChkGroup.Items.Count(); ++i)
        {
            if (!tblChkGroup.Items[i].Checked)
            {
                strStat += tblChkGroup.Items[i].Tag.Trim() + ",";
            }
        }

        strStat = strStat.Length > 0 ? strStat.Substring(0, strStat.Length - 1) : strStat;

        if (txtCode.Text.Trim() == "")
        {
            div_bottom.Html = "<p class=\"error\">Status : Saved failed , code can't be empty! </p>";
        }
        else if (BaseCheckCode.Check("SERVICEMODE", txtCode.Text.ToUpper().Trim(), "", txtRowID.Text) == "N")
        {
            txtCode.Focus(true);
            div_bottom.Html = "<p class=\"error\">Status : Saved failed ,the code already exists! </p>";
            return;
        }
        else
        {
            DataFactory dal = new DataFactory();
            bool        b   = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_BasicData_ServiceMode_SP", new List <IFields>()
            {
                dal.CreateIFields().Append("Option", "Update")
                .Append("sm_CODE", txtCode.Text.Trim().ToUpper())
                .Append("sm_Description", txtDes.Text.Trim().ToUpper())
                .Append("sm_CalcUnit", CmbCalc.SelectedItem.Value)
                .Append("sm_Group", CmbGroup.SelectedItem.Value)
                .Append("sm_BLString", txtLine.Text.Trim().ToUpper())
                .Append("sm_Active", ChbActive.Checked?"1":"0")
                .Append("sm_STAT", FSecurityHelper.CurrentUserDataGET()[12])
                .Append("sm_User", FSecurityHelper.CurrentUserDataGET()[0])
                .Append("sm_ROWID", txtRowID.Text)
                .Append("statstr", strStat)
                .Append("dept", FSecurityHelper.CurrentUserDataGET()[28].ToUpper())
            }).Update();
            if (b)
            {
                //X.Msg.Alert("status", " Saved successfully").Show();
                if (!string.IsNullOrEmpty(Request["control"]))
                {
                    X.AddScript("window.parent.ChildCallBack(Request(\"control\"), txtCode.getValue());");
                    return;
                }

                if (i == 1)
                {
                    txtRowID.Text = "";
                    txtCode.Text  = "";
                    txtDes.Text   = "";
                    txtLine.Text  = "";
                    CmbCalc.SelectedItem.Value  = "";
                    CmbGroup.SelectedItem.Value = "";
                    ChbActive.Checked           = true;
                    CheckGroupChecked();
                    txtCode.Focus();
                    txtCode.Disabled = false;
                }
                else
                {
                    txtCode.Disabled = true;
                    txtRowID.Text    = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_BasicData_ServiceMode_SP", new List <IFields>()
                    {
                        dal.CreateIFields()
                        .Append("Option", "List")
                        .Append("sm_STAT", FSecurityHelper.CurrentUserDataGET()[12])
                        .Append("dept", FSecurityHelper.CurrentUserDataGET()[28].ToUpper())
                        .Append("sm_CODE", txtCode.Text)
                        .Append("isGetId", 1)
                    }).GetTable().Rows[0][0].ToString();
                }
                div_bottom.Html = "<p class='success'>Status: Saved successful . </p>";
            }
            else
            {
                div_bottom.Html = "<p class='error'>Status: Saved failed , please check the data ! </p>";
            }
            DataBinder();
            txtCode.Focus();
        }
    }
예제 #4
0
    /// <summary>
    /// btnSave 保存事件
    /// </summary>
    #region  btnSave_Click(object, EventArgs) Author:Micro (2011-08-27)
    protected void btnSave_Click(object sender, EventArgs e)
    {
        string strStat = "";

        for (int i = 0; i < tblChkGroup.Items.Count(); ++i)
        {
            if (!tblChkGroup.Items[i].Checked)
            {
                strStat += tblChkGroup.Items[i].Tag.Trim() + ",";
            }
        }
        strStat = strStat.Length > 0 ? strStat.Substring(0, strStat.Length - 1) : strStat;

        if (string.IsNullOrEmpty(txtCode.Text.Trim()))
        {
            div_bottom.Html = "<p class=\"error\">Status : Saved failed , code can't be empty! </p>";
            txtCode.Focus();
            return;
        }

        if (string.IsNullOrEmpty(txtShort.Text.Trim()))
        {
            div_bottom.Html = "<p class=\"error\">Status : Saved failed , short can't be empty! </p>";
            txtShort.Focus();
            return;
        }

        if (string.IsNullOrEmpty(txtDes.Text.Trim()))
        {
            div_bottom.Html = "<p class=\"error\">Status : Saved failed , Description can't be empty! </p>";
            txtDes.Focus();
            return;
        }

        if (BaseCheckCode.Check("DOMESTICSTATUS", txtCode.Text.ToUpper().Trim(), "", txtRowID.Text) == "N")
        {
            txtCode.Focus(true);
            div_bottom.Html = "<p class=\"error\">Status : Saved failed ,the code already exists! </p>";
            //X.Msg.Alert("Information", "The code already exists!").Show();
            return;
        }

        bool b = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_BasicData_DomesticKid_SP", new List <IFields>()
        {
            dal.CreateIFields().Append("Option", "AddModify")
            .Append("dk_Code", txtCode.Text.Trim())
            .Append("dk_Description", txtDes.Text.Trim())
            .Append("dk_Short", txtShort.Text.Trim())
            .Append("dk_Active", ChbActive.Checked == true?1:0)
            .Append("dk_ROWID", txtRowID.Text.Trim())
            .Append("dept", FSecurityHelper.CurrentUserDataGET()[28].ToUpper())
            .Append("statstr", strStat)
        }).Update();

        if (b)
        {
            if (!string.IsNullOrEmpty(Request["control"]))
            {
                X.AddScript("window.parent.ChildCallBack(Request(\"control\"), $(\"#txtCode\").val());");
                return;
            }
            if (i == 1)
            {
                CotrolsInitial();
                txtCode.Disabled = false;
                CheckGroupChecked();
            }
            else
            {
                txtCode.Disabled = true;
                txtRowID.Text    = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_BasicData_DomesticKid_SP", new List <IFields>()
                {
                    dal.CreateIFields().Append("Option", "List")
                    .Append("dept", FSecurityHelper.CurrentUserDataGET()[28].ToUpper())
                    .Append("dk_Code", txtCode.Text.Trim())
                    .Append("isGetId", 1)
                }).GetTable().Rows[0][0].ToString();
            }

            //X.Msg.Alert("Status", " Saved successfully !!!", new JFunction { Fn = "TextFocus" }).Show();
            div_bottom.Html = "<p class='success'>Status: Saved successful . </p>";
        }
        else
        {
            //X.Msg.Alert("Status", " Save failed !!! ", new JFunction { Fn = "TextFocus" }).Show();
            div_bottom.Html = "<p class='error'>Status: Saved failed , please check the data ! </p>";
        }
        txtCode.Focus(true);
        DataBinder();
    }
예제 #5
0
    //protected void Binding(object sender, DirectEventArgs e)
    //{
    //    BindData();
    //}

    protected void btnSave_Click(object sender, DirectEventArgs e)
    {
        string strStat = "";

        for (int i = 0; i < tblChkGroup.Items.Count(); ++i)
        {
            if (!tblChkGroup.Items[i].Checked)
            {
                strStat += tblChkGroup.Items[i].Tag.Trim() + ",";
            }
        }

        strStat = strStat.Length > 0 ? strStat.Substring(0, strStat.Length - 1) : strStat;

        if (string.IsNullOrEmpty(Code.Text))
        {
            Code.Text = "";
            Code.Focus();
            div_bottom.Html = "<p class=\"error\">Status : Saved failed , code can't be empty ! </p>";
            //X.Msg.Alert("Status", "Code can't be null", "Code.focus();").Show();
            return;
        }

        if (string.IsNullOrEmpty(Short.Text))
        {
            //X.Msg.Alert("Status", "Short can't be null", "Code.focus();").Show();
            Short.Text = "";
            Short.Focus();
            div_bottom.Html = "<p class=\"error\">Status : Saved failed , short can't be empty ! </p>";
            return;
        }

        if (string.IsNullOrEmpty(txtEDI.Text))
        {
            //X.Msg.Alert("Status", "Short can't be null", "Code.focus();").Show();
            txtEDI.Text = "";
            txtEDI.Focus();
            div_bottom.Html = "<p class=\"error\">Status : Saved failed , EDI can't be empty ! </p>";
            return;
        }

        if (BaseCheckCode.Check("UNIT", Code.Text.ToUpper().Trim(), "", hidRowID.Text) == "N")
        {
            Code.Focus(true);
            div_bottom.Html = "<p class=\"error\">Status : Saved failed ,the code already exists! </p>";
            //X.Msg.Alert("Information", "The code already exists!").Show();
            return;
        }

        bool bFlag = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_BasicData_Unit_SP", new List <IFields>()
        {
            dal.CreateIFields().Append("Option", "Update")
            .Append("User", FSecurityHelper.CurrentUserDataGET()[0])
            .Append("SYS", DBNull.Value)
            .Append("dept", FSecurityHelper.CurrentUserDataGET()[28].ToUpper())
            .Append("STAT", FSecurityHelper.CurrentUserDataGET()[12])
            .Append("Code", Code.Text.ToUpper().Trim())
            .Append("EDI", txtEDI.Text.ToUpper().Trim())
            .Append("Short", Short.Text.ToUpper().Trim())
            .Append("Description", Description.Text.ToUpper().Trim())
            .Append("Active", chkActive.Checked?"1":"0")
            .Append("ROWID", hidRowID.Text.Trim())
            .Append("statstr", strStat)
        }).Update();

        if (bFlag)
        {
            if (!string.IsNullOrEmpty(Request["control"]))
            {
                X.AddScript("window.parent.ChildCallBack(Request(\"control\"), Code.getValue().toUpperCase(),'');");
                return;
            }

            if (i == 1)
            {
                Code.Text         = "";
                txtEDI.Text       = "";
                Short.Text        = "";
                Description.Text  = "";
                hidRowID.Text     = "0";
                chkActive.Checked = true;
                CheckGroupChecked();
                Code.Disabled = false;
                Code.Focus(true);
            }
            else
            {
                Code.Disabled = true;
                Short.Focus(true);
                hidRowID.Text = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_BasicData_Unit_SP", new List <IFields>()
                {
                    dal.CreateIFields().Append("Option", "List")
                    .Append("STAT", FSecurityHelper.CurrentUserDataGET()[12])
                    .Append("dept", FSecurityHelper.CurrentUserDataGET()[28].ToUpper())
                    .Append("Code", Code.Text.Trim())
                    .Append("isGetId", 1)
                }).GetTable().Rows[0][0].ToString();
            }
            //X.Msg.Alert("Status", "saved successful", "Code.focus();").Show();
            div_bottom.Html = "<p class='success'>Status: Saved successful . </p>";
        }
        else
        {
            div_bottom.Html = "<p class='error'>Status: Saved failed , please check the data ! </p>";
        }
        this.BindData();
        Code.Focus(true);
    }
예제 #6
0
    protected void btnSave_Click(object sender, DirectEventArgs e)
    {
        string strStat = "";

        for (int i = 0; i < ChkGrpStat.Items.Count(); ++i)
        {
            if (!ChkGrpStat.Items[i].Checked)
            {
                strStat += ChkGrpStat.Items[i].Tag.Trim() + ",";
            }
        }
        strStat = strStat.Length > 0 ? strStat.Substring(0, strStat.Length - 1) : strStat;

        if (string.IsNullOrEmpty(Code.Text))
        {
            this.Code.Text = "";
            this.Code.Focus();
            div_bottom.Html = "<p class=\"error\">Status : Error message, The code can't for empty . </p>";
            //X.Msg.Alert("Status", "Code can't be null", "Code.focus();").Show();
            return;
        }

        if (BaseCheckCode.Check("currency", Code.Text.Trim(), sys, hidRowID.Text) == "N" && hidRowID.Text == "0")
        {
            div_bottom.Html = "<p class=\"error\">Status : Error message, The code already exists. </p>";
            return;
        }

        int f = 0, l = 0, b = 0;

        if (Checkforeign.Checked)
        {
            f = 1;
            b = 1;
        }
        if (chkLocal.Checked)
        {
            l = 1;
            b = 1;
        }

        DataSet ds = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_BasicData_Currency_SP", new List <IFields>()
        {
            dal.CreateIFields().Append("Option", "Update")
            .Append("User", FSecurityHelper.CurrentUserDataGET()[0])
            .Append("dept", dept)
            .Append("SYS", sys)
            .Append("STAT", FSecurityHelper.CurrentUserDataGET()[12])
            //.Append("statstr",string.IsNullOrEmpty(strStat)?FSecurityHelper.CurrentUserDataGET()[12]:strStat)
            .Append("statstr", strStat)
            .Append("Code", Code.Text.ToUpper())
            .Append("Description", Description.Text.ToUpper())
            .Append("Country", Country.Text)
            .Append("Rate", string.IsNullOrEmpty(txtRate.Text.Trim()) ? DBNull.Value : (object)txtRate.Text.Trim())
            .Append("Sell", string.IsNullOrEmpty(txtSell.Text.Trim()) ? DBNull.Value : (object)txtSell.Text.Trim())
            .Append("Buy", string.IsNullOrEmpty(txtBuy.Text.Trim()) ? DBNull.Value : (object)txtBuy.Text.Trim())
            .Append("Active", chkActive.Checked?"1":"0")
            .Append("ROWID", hidRowID.Text)
            .Append("cur_BuildIn", b)
            .Append("cur_isForeign", f)
            .Append("cur_isLocal", l)
        }).GetList();

        if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
        {
            hidRowID.Text = ds.Tables[0].Rows[0][0].ToString();
            Code.Disabled = true;
            if (dept != "ACCOUNT")
            {
                txtBuy.Disabled  = true;
                txtSell.Disabled = true;
                txtRate.Disabled = true;
            }
            if (!string.IsNullOrEmpty(Request["control"]))
            {
                X.AddScript("window.parent.ChildCallBack(Request(\"control\"), $(\"#Code\").val());");
                return;
            }
            if (i == 1)
            {
                Code.Text        = "";
                Description.Text = "";
                Country.Text     = "";
                txtRate.Clear();
                txtSell.Clear();
                txtBuy.Clear();
                chkLocal.Checked     = false;
                Checkforeign.Checked = true;
                hidRowID.Text        = "0";
                chkActive.Checked    = true;
                Code.Disabled        = false;
                CheckGroupClear();
                txtBuy.Disabled  = false;
                txtSell.Disabled = false;
                txtRate.Disabled = false;
            }
            div_bottom.Html = "<p class=\"success\">Status : saved successful. </p>";
        }
        else
        {
            div_bottom.Html = "<p class=\"error\">Status : Error message, saved failed. </p>";
        }

        this.BindData();
    }
예제 #7
0
    protected void btnSave_Click(object sender, DirectEventArgs e)
    {
        string strStat = "";

        for (int i = 0; i < tblChkGroup.Items.Count(); ++i)
        {
            if (!tblChkGroup.Items[i].Checked)
            {
                strStat += tblChkGroup.Items[i].Tag.Trim() + ",";
            }
        }

        strStat = strStat.Length > 0 ? strStat.Substring(0, strStat.Length - 1) : strStat;

        if (string.IsNullOrEmpty(Code.Text))
        {
            Code.Focus(true);
            div_bottom.Html = "<p class='error'>Status : The code can't be empty .</p>";
            return;
        }
        if (string.IsNullOrEmpty(Name.Text))
        {
            Name.Focus(true);
            div_bottom.Html = "<p class='error'>Status : The description can't be empty .</p>";
            return;
        }

        if (string.IsNullOrEmpty(Country.Text))
        {
            Country.Focus(true);
            div_bottom.Html = "<p class='error'>Status : The country can't be empty .</p>";
            return;
        }

        if (Code.Text.Trim().Length < 3)
        {
            Code.Focus(true);
            div_bottom.Html = "<p class=\"error\">Status : The Code length can not be less than 3 . </p>";
            return;
        }

        if (BaseCheckCode.Check("location", Code.Text.ToUpper().Trim(), sys, hidRowID.Text) == "N")
        {
            Code.Focus(true);
            div_bottom.Html = "<p class=\"error\">Status : Saved failed ,the code already exists! </p>";
            return;
        }

        bool bFlag = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_BasicData_Location_SP", new List <IFields>()
        {
            dal.CreateIFields().Append("Option", "Update")
            .Append("User", FSecurityHelper.CurrentUserDataGET()[0])
            .Append("SYS", sys)
            .Append("STAT", FSecurityHelper.CurrentUserDataGET()[12])
            .Append("Code", Code.Text.ToUpper().Trim())
            .Append("Name", Name.Text.Trim().ToUpper())
            .Append("Country", Country.Value)
            .Append("City", City.Text.ToUpper().Trim())
            .Append("Currency", Currency.Value)
            .Append("AirAgent", AirAgent.Value)
            .Append("OceanAgent", OceanAgent.Value)
            .Append("Active", chkActive.Checked?"1":"0")
            .Append("ROWID", hidRowID.Text)
            .Append("statstr", strStat)
            .Append("dept", FSecurityHelper.CurrentUserDataGET()[28].ToUpper())
        }).Update();

        if (bFlag)
        {
            if (!string.IsNullOrEmpty(Request["control"]))
            {
                X.AddScript("window.parent.ChildCallBack(Request(\"control\"), $(\"#Code\").val());");
                return;
            }

            if (i == 1)
            {
                Code.Text     = "";
                Name.Text     = "";
                Country.Text  = "";
                City.Text     = "";
                Currency.Text = "";
                AirAgent.setValue("");
                OceanAgent.setValue("");
                hidRowID.Text     = "0";
                chkActive.Checked = true;
                Code.Disabled     = false;
                Code.Focus(true);
                CheckGroupChecked();
            }
            else
            {
                Code.Disabled = true;
                hidRowID.Text = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_BasicData_Location_SP", new List <IFields>()
                {
                    dal.CreateIFields().Append("Option", "List")
                    .Append("SYS", sys)
                    .Append("code", Code.Text)
                    .Append("STAT", FSecurityHelper.CurrentUserDataGET()[12])
                    .Append("dept", FSecurityHelper.CurrentUserDataGET()[28])
                    .Append("num", 1)
                }).GetTable().Rows[0][0].ToString();
            }
            div_bottom.Html = "<p class='success'>Status: Saved successful . </p>";
            //next = true;
            this.BindData();
        }
        else
        {
            // X.Msg.Alert("Status", "saved failed", "Code.focus();").Show();
            div_bottom.Html = "<p class='error'>Status: Saved failed , please check the data ! </p>";
            Code.Focus();
            //next = false;
        }
    }
예제 #8
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        string strStat = "";

        for (int i = 0; i < tblChkGroup.Items.Count(); ++i)
        {
            if (!tblChkGroup.Items[i].Checked)
            {
                strStat += tblChkGroup.Items[i].Tag.Trim() + ",";
            }
        }

        strStat = strStat.Length > 0 ? strStat.Substring(0, strStat.Length - 1) : strStat;

        if (txtCode.Text.Trim() == "")
        {
            //X.Msg.Alert("Information", "Code can't be empty!").Show();
            div_bottom.Html = "<p class=\"error\">Status : Saved failed , code can't be empty ! </p>";
            txtCode.Focus();
        }

        if (txtisocode.Text.Trim() == "")
        {
            //X.Msg.Alert("Information", "Code can't be empty!").Show();
            div_bottom.Html = "<p class=\"error\">Status : Saved failed , EDI Code can't be empty ! </p>";
            txtisocode.Focus();
        }
        else if (CmbGroup.SelectedItem.Value == null)
        {
            //X.Msg.Alert("Information", "Group can't be empty!").Show();
            div_bottom.Html = "<p class=\"error\">Status : Saved failed , group can't be empty ! </p>";
            CmbGroup.Focus();
        }
        else if (BaseCheckCode.Check("CONTAINER SIZE", txtCode.Text.ToUpper().Trim(), sys, txtRowID.Text) == "N")
        {
            txtCode.Focus(true);
            div_bottom.Html = "<p class=\"error\">Status : Saved failed , the code already exists ! </p>";
            //X.Msg.Alert("Information", "The code already exists!").Show();
            return;
        }
        else
        {
            string      a   = FSecurityHelper.CurrentUserDataGET()[12].ToString();
            DataFactory dal = new DataFactory();
            bool        b   = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_BasicData_ContainerSize_SP", new List <IFields>()
            {
                dal.CreateIFields().Append("Option", "Update")
                .Append("ctnr_Code", txtCode.Text.Trim().ToUpper())
                .Append("ctnr_EDI", txtisocode.Text.Trim().ToUpper())
                .Append("ctnr_Description", txtDes.Text.Trim().ToUpper())
                .Append("ctnr_ContainerType", CmbCalc.SelectedItem.Value)
                .Append("ctnr_Group", CmbGroup.SelectedItem.Value)
                .Append("ctnr_Length", string.IsNullOrEmpty(txtLong.Text.Trim().ToUpper()) ? DBNull.Value : (object)txtLong.Text.Trim().ToUpper())
                .Append("ctnr_Active", ChbActive.Checked?"1":"0")
                .Append("ctnr_STAT", FSecurityHelper.CurrentUserDataGET()[12])
                .Append("ctnr_User", FSecurityHelper.CurrentUserDataGET()[0])
                .Append("ctnr_ROWID", txtRowID.Text)
                .Append("statstr", strStat)
                .Append("dept", FSecurityHelper.CurrentUserDataGET()[28].ToUpper())
            }).Update();
            if (b)
            {
                //X.Msg.Alert("status", " Saved successfully").Show();
                if (!string.IsNullOrEmpty(Request["control"]))
                {
                    X.AddScript("window.parent.ChildCallBack(Request(\"control\"), $(\"#txtCode\").val());");
                    return;
                }

                if (i == 1)
                {
                    InitCotrol();
                    txtCode.Disabled = false;
                    CheckGroupChecked();
                }
                else
                {
                    txtCode.Disabled = true;
                    txtRowID.Text    = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_BasicData_ContainerSize_SP", new List <IFields>()
                    {
                        dal.CreateIFields()
                        .Append("Option", "List")
                        .Append("ctnr_STAT", FSecurityHelper.CurrentUserDataGET()[12])
                        .Append("dept", FSecurityHelper.CurrentUserDataGET()[28].ToUpper())
                        .Append("ctnr_Code", txtCode.Text)
                        .Append("isGetId", 1)
                    }).GetTable().Rows[0][0].ToString();
                }
                //X.Msg.Alert("Status", " saved successful ! ").Show();
                div_bottom.Html = "<p class='success'>Status: Saved successful . </p>";
            }
            else
            {
                div_bottom.Html = "<p class='error'>Status: Saved failed , please check the data ! </p>";
                //X.Msg.Alert("status", " Save failed ").Show();
            }
            DataBinder();
            txtCode.Focus();
        }
    }