Esempio n. 1
0
    /// <summary>
    /// 執行
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnExecute_Click(object sender, EventArgs e)
    {
        try
        {
            StringBuilder sb = new StringBuilder();

            #region 檢查複製條件
            if (this.txt_DIS_NO_OLD.Text == "")
            { sb.Append("配本序號不可為空值 \n\r"); }
            if (this.SLP_SKU_OLD.Text == "")
            { sb.Append("品號不可為空值 \n\r"); }
            if (this.SLP_ItemPeriod_OLD.Text == "")
            { sb.Append("期別不可為空值 \n\r"); }
            if (this.SLP_SKU_NEW.Text == "")
            { sb.Append("新品號不可為空值 \n\r"); }
            if (this.SLP_ItemPeriod_NEW.Text == "")
            { sb.Append("新期別不可為空值 \n\r"); }
            if (sb.ToString().Trim() != "")
            {
                throw new Exception(sb.ToString().Trim());
            }
            #endregion

            #region 執行複製
            ArrayList ParameterList = new ArrayList();//20091113
            ParameterList.Clear();
            ParameterList.Add(this.txt_DIS_NO_OLD.Text);//配本序號
            ParameterList.Add(this.SLP_SKU_OLD.Text);//品號
            ParameterList.Add(this.SLP_ItemPeriod_OLD.Text);//期別
            ParameterList.Add(this.SLP_SKU_NEW.Text);//新品號
            ParameterList.Add(this.SLP_ItemPeriod_NEW.Text);//新期別
            ParameterList.Add(Session["UID"].ToString());//使用者

            ALOModel.MaintainDisRecord BCOM = new ALOModel.MaintainDisRecord(ConnectionDB);
            string sDis_No_New = BCOM.CopyToNewRecord(ParameterList, null);
            
            this.RightMsgLabel.Text = "執行成功";
            this.txt_DIS_NO_NEW.Text = sDis_No_New;
            
            //string strJS = string.Format("alert(執行成功');", txt_DIS_NO_NEW.ClientID, txt_DIS_NO_NEW.Text);
            //ScriptManager.RegisterStartupScript(Page, this.GetType(), "ALO115.aspx", strJS, true);


            #endregion
        }
        catch (Exception ex)
        {
            WaringLogProcess(ex.Message);
            this.ErrorMsgLabel.Text = ex.Message;
        }
    }