예제 #1
0
        private void btnMoveNew_Click(object sender, System.EventArgs e)
        {
            DataTable dtDetail = (DataTable)Session["MoveDetail"];
            Hashtable htapp    = (Hashtable)Application["appconf"];
            string    strcons  = (string)htapp["cons"];

            StoBusi = new BusiComm.StorageBusi(strcons);
            Hashtable htpara = new Hashtable();

            CMSMStruct.LoginStruct ls1 = (CMSMStruct.LoginStruct)Session["Login"];

            switch (this.txtBillState.Text.Trim())
            {
            case "":
                #region 新调拨单录入出货
                if (dtDetail.Rows.Count == 0)
                {
                    this.SetErrorMsgPageBydirHistory("调拨产品为空,请先添加产品!");
                    return;
                }
                string strOutDeptID = this.ddlOutDept.SelectedValue;
                string strInDeptID  = this.ddlInDept.SelectedValue;
                string strMoveDate  = strBeginDate;
                string strOutOperID = this.txtOutOperID.Text.Trim();
                string strInOperID  = this.txtInOperID.Text.Trim();
                string strOperDate  = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString();
                string strOperID    = ls1.strOperName;

                if (strOutOperID == "")
                {
                    this.SetErrorMsgPageBydirHistory("调出人不能为空!");
                    return;
                }

                htpara.Add("strOutDeptID", strOutDeptID);
                htpara.Add("strInDeptID", strInDeptID);
                htpara.Add("strMoveDate", strMoveDate);
                htpara.Add("strOutOperID", strOutOperID);
                htpara.Add("strInOperID", strInOperID);
                htpara.Add("strOperDate", strOperDate);
                htpara.Add("strOperID", strOperID);

                try
                {
                    if (StoBusi.NewProductMoveAdd(htpara, dtDetail))
                    {
                        this.SetSuccMsgPageBydir("新调拨单录入成功!", "Storage/wfmProductMove.aspx");
                    }
                    else
                    {
                        this.SetErrorMsgPageBydir("新调拨单录入时发生错误,请重试!");
                    }
                }
                catch (Exception er)
                {
                    this.clog.WriteLine(er);
                    this.SetErrorMsgPageBydir("查询错误,请重试!");
                }
                #endregion
                break;

            case "0":
                #region 调拨单--验收入库
                if (this.txtInOperID.Text.Trim() == "")
                {
                    this.SetErrorMsgPageBydirHistory("调入人不能为空!");
                    return;
                }
                htpara.Add("MoveID", this.txtMoveID.Text.Trim());
                htpara.Add("strInDeptID", this.ddlInDept.SelectedValue);
                htpara.Add("strMoveInOper", this.txtInOperID.Text.Trim());
                htpara.Add("strOperDate", DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString());
                htpara.Add("strOperID", ls1.strOperName);
                try
                {
                    if (StoBusi.UpdateProductMoveValidEnter(htpara, dtDetail))
                    {
                        this.SetSuccMsgPageBydir("调拨单收货成功!", "Storage/wfmProductMove.aspx");
                    }
                    else
                    {
                        this.SetErrorMsgPageBydir("调拨单收货时发生错误,请重试!");
                    }
                }
                catch (Exception er)
                {
                    this.clog.WriteLine(er);
                    this.SetErrorMsgPageBydir("查询错误,请重试!");
                }
                #endregion
                break;
            }
        }