private void Closed()
        {
            string    strPoID = this.txtPoID.Text.Trim();
            Hashtable htapp   = (Hashtable)Application["appconf"];
            string    strcons = (string)htapp["cons"];

            StoBusi = new BusiComm.StorageBusi(strcons);
            try
            {
                CMSMStruct.LoginStruct ls1 = (CMSMStruct.LoginStruct)Session["Login"];
                if (StoBusi.PoSotckMainClose(strPoID, ls1.strOperName))
                {
                    this.SetSuccMsgPageBydir("采购订单完成成功!", "Storage/wfmPoStock.aspx");
                    return;
                }
                else
                {
                    this.SetErrorMsgPageBydir("采购订单完成时发生错误,请重试!");
                    return;
                }
            }
            catch (Exception er)
            {
                this.clog.WriteLine(er);
                this.SetErrorMsgPageBydir("查询错误,请重试!");
                return;
            }
        }
Exemple #2
0
        private DataTable SeachGoods()
        {
            DataTable dtout   = new DataTable();
            Hashtable htapp   = (Hashtable)Application["appconf"];
            string    strcons = (string)htapp["cons"];

            StoBusi = new BusiComm.StorageBusi(strcons);
            try
            {
                string strGoodType = this.ddlGoodType.SelectedValue;
                string strGoodName = this.txtGoodName.Text.Trim();
                if (strGoodType == "全部")
                {
                    strGoodType = "";
                }
                if (!(strGoodType == "" && strGoodName == ""))
                {
                    dtout = StoBusi.ChartSeachGoods(strGoodType, strGoodName);
                }
                return(dtout);
            }
            catch (Exception er)
            {
                this.clog.WriteLine(er);
                this.SetErrorMsgPageBy2dir("查询错误,请重试!");
                return(dtout);
            }
        }
Exemple #3
0
        protected DataTable Query(string strAcctMonth, string strGoodsID)
        {
            DataTable dtout   = new DataTable();
            Hashtable htapp   = (Hashtable)Application["appconf"];
            string    strcons = (string)htapp["cons"];

            StoBusi = new BusiComm.StorageBusi(strcons);
            try
            {
                dtout = StoBusi.GetGoodsChart(strAcctMonth, strGoodsID);
                if (dtout == null)
                {
                    this.SetErrorMsgPageBy2dir("查询出错,请重试!");
                    return(dtout);
                }
                else
                {
                    return(dtout);
                }
            }
            catch (Exception er)
            {
                this.clog.WriteLine(er);
                this.SetErrorMsgPageBy2dir("查询错误,请重试!");
                return(dtout);
            }
        }
Exemple #4
0
 protected void btnRelativeMakeToReceive_Click(object sender, System.EventArgs e)
 {
     if (Session["ToReceive"] != null)
     {
         DataTable dtIn = (DataTable)Session["ToReceive"];
         if (dtIn.Rows.Count > 0)
         {
             Hashtable htapp   = (Hashtable)Application["appconf"];
             string    strcons = (string)htapp["cons"];
             StoBusi = new BusiComm.StorageBusi(strcons);
             try
             {
                 if (!StoBusi.RelativeMakeToReceive(dtIn))
                 {
                     this.SetErrorMsgPageBydir("关联错误,请重试!");
                     return;
                 }
                 else
                 {
                     Session.Remove("ToReceive");
                     this.SetSuccMsgPageBydir("关联成功!", "Storage/wfmMakeBillRelativeReceive.aspx");
                     return;
                 }
             }
             catch (Exception er)
             {
                 this.clog.WriteLine(er);
                 this.SetErrorMsgPageBydir("关联错误,请重试!");
                 return;
             }
         }
     }
 }
        private void DataGrid1_DeleteCommand(object source, DataGridCommandEventArgs e)
        {
            string strSerial = e.Item.Cells[0].Text.Trim();

            if (strSerial == "")
            {
                this.SetErrorMsgPageBydirHistory("找不到要删除的数据!");
                return;
            }
            else
            {
                Hashtable htapp   = (Hashtable)Application["appconf"];
                string    strcons = (string)htapp["cons"];
                StoBusi = new BusiComm.StorageBusi(strcons);
                try
                {
                    if (StoBusi.SaleLoseDelete(strSerial))
                    {
                        this.SetSuccMsgPageBydir("删除损耗记录成功!", "Storage/wfmSaleLoseQuery.aspx");
                        return;
                    }
                    else
                    {
                        this.SetErrorMsgPageBydir("删除损耗记录时发生错误,请重试!");
                        return;
                    }
                }
                catch (Exception er)
                {
                    this.clog.WriteLine(er);
                    this.SetErrorMsgPageBydir("查询错误,请重试!");
                    return;
                }
            }
        }
        private void btnQuery_Click(object sender, System.EventArgs e)
        {
            string    strMonth = this.ddlMonth.SelectedItem.Text;
            Hashtable htapp    = (Hashtable)Application["appconf"];
            string    strcons  = (string)htapp["cons"];

            StoBusi = new BusiComm.StorageBusi(strcons);
            try
            {
                DataTable dtout = StoBusi.GetStockPlanQuery(strMonth);
                if (dtout == null)
                {
                    this.SetErrorMsgPageBydir("²éѯ³ö´í£¬ÇëÖØÊÔ£¡");
                    return;
                }
                else
                {
                    dtout.TableName  = "²É¹º¼Æ»®±í";
                    Session["QUERY"] = dtout;
                }

                UcPageView1.MyDataGrid.PageSize = 20;
                DataView dvOut = new DataView(dtout);
                this.UcPageView1.MyDataSource = dvOut;
                this.UcPageView1.BindGrid();
            }
            catch (Exception er)
            {
                this.clog.WriteLine(er);
                this.SetErrorMsgPageBydir("²éѯ´íÎó£¬ÇëÖØÊÔ£¡");
                return;
            }
        }
        protected void btnFind_Click(object sender, System.EventArgs e)
        {
            string strProviderCode = this.txtProviderCode.Text.Trim();

            if (strProviderCode == "")
            {
                this.SetErrorMsgPageBydirHistory("请输入供应商编码!");
                return;
            }
            Hashtable htapp   = (Hashtable)Application["appconf"];
            string    strcons = (string)htapp["cons"];

            StoBusi = new BusiComm.StorageBusi(strcons);
            try
            {
                string strProviderName = StoBusi.IsExistProvider(strProviderCode);
                if (strProviderName == "")
                {
                    this.txtProviderName.Text    = "";
                    this.txtProviderName.Enabled = true;
                }
                else
                {
                    this.txtProviderName.Text    = strProviderName;
                    this.txtProviderName.Enabled = false;
                }
            }
            catch (Exception er)
            {
                this.clog.WriteLine(er);
                this.SetErrorMsgPageBydir("查询错误,请重试!");
                return;
            }
        }
Exemple #8
0
        private void dgbind()
        {
            Hashtable htapp   = (Hashtable)Application["appconf"];
            string    strcons = (string)htapp["cons"];

            StoBusi = new BusiComm.StorageBusi(strcons);
            DataTable dtout = StoBusi.GetProviderToGoods(this.txtProviderID.Text.Trim(), this.txtProviderName.Text.Trim());

            if (dtout == null)
            {
                this.SetErrorMsgPageBydir("查询出错,请重试!");
                return;
            }
            else
            {
                this.TableConvert(dtout, "采购计量单位", "ComputationUnit");
                dtout.TableName = "供应商供应货品清单";
                DataTable dtexcel = dtout.Copy();
                Session["QUERY"] = dtout;
            }

            UcPageView1.MyDataGrid.PageSize = 10;
            DataView dvOut = new DataView(dtout);

            this.UcPageView1.MyDataSource = dvOut;
            this.UcPageView1.BindGrid();
        }
Exemple #9
0
        protected void btnAllOK_Click(object sender, System.EventArgs e)
        {
            DataTable dtLoseList = (DataTable)Session["NewLoseList"];

            if (dtLoseList == null || dtLoseList.Rows.Count == 0 || this.DataGrid1.Items.Count == 0)
            {
                this.SetErrorMsgPageBydirHistory("没有录入任何损耗信息,请先录入!");
                return;
            }
            else
            {
                Hashtable htapp   = (Hashtable)Application["appconf"];
                string    strcons = (string)htapp["cons"];
                StoBusi = new BusiComm.StorageBusi(strcons);
                try
                {
                    if (StoBusi.NewSaleLoseAdd(dtLoseList))
                    {
                        this.SetSuccMsgPageBydir("报损成功!", "Storage/wfmSaleLoseQuery.aspx");
                        return;
                    }
                    else
                    {
                        this.SetErrorMsgPageBydir("报损时发生错误,请重试!");
                        return;
                    }
                }
                catch (Exception er)
                {
                    this.clog.WriteLine(er);
                    this.SetErrorMsgPageBydir("查询错误,请重试!");
                    return;
                }
            }
        }
        protected void btnNewPlan_Click(object sender, System.EventArgs e)
        {
            DataTable dtDetail = (DataTable)Session["PalnDetail"];

            if (dtDetail.Rows.Count == 0)
            {
                this.SetErrorMsgPageBydirHistory("采购计划产品为空,请先添加产品!");
                return;
            }

            Hashtable htapp   = (Hashtable)Application["appconf"];
            string    strcons = (string)htapp["cons"];

            StoBusi = new BusiComm.StorageBusi(strcons);
            try
            {
                if (StoBusi.NewStockPlanAdd(dtDetail))
                {
                    this.SetSuccMsgPageBydir("新采购计划录入成功!", "Storage/wfmStockPlan.aspx");
                    return;
                }
                else
                {
                    this.SetErrorMsgPageBydir("新采购计划录入时发生错误,请重试!");
                    return;
                }
            }
            catch (Exception er)
            {
                this.clog.WriteLine(er);
                this.SetErrorMsgPageBydir("查询错误,请重试!");
                return;
            }
        }
Exemple #11
0
        private void ddlProduct_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            string    strProductCode = this.ddlProduct.SelectedValue;
            Hashtable htapp          = (Hashtable)Application["appconf"];
            string    strcons        = (string)htapp["cons"];

            StoBusi = new BusiComm.StorageBusi(strcons);
            try
            {
                string strUnit = StoBusi.GetGoodsUnit(strProductCode);
                if (strUnit == null || strUnit == "")
                {
                    this.txtUnit.Text = "不存在";
                }
                else
                {
                    this.txtUnit.Text = strUnit;
                }
            }
            catch (Exception er)
            {
                this.clog.WriteLine(er);
                this.SetErrorMsgPageBydir("查询错误,请重试!");
                return;
            }
        }
Exemple #12
0
        protected void btnSendOK_Click(object sender, System.EventArgs e)
        {
            DataTable dtSendReceiveID = (DataTable)Session["SendReceiveID"];
            Hashtable htapp           = (Hashtable)Application["appconf"];
            string    strcons         = (string)htapp["cons"];

            StoBusi = new BusiComm.StorageBusi(strcons);
            try
            {
                CMSMStruct.LoginStruct ls1 = (CMSMStruct.LoginStruct)Session["Login"];
                string strOperDate         = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString();
                if (StoBusi.UpdateBatchBillOfReceiveSend(dtSendReceiveID, ls1.strOperName, strOperDate))
                {
                    this.SetSuccMsgPageBydir("领料单发货成功!", "Storage/wfmBillOfReceive.aspx");
                }
                else
                {
                    this.SetErrorMsgPageBydir("领料单发货时发生错误,请重试!");
                }
            }
            catch (Exception er)
            {
                this.clog.WriteLine(er);
                this.SetErrorMsgPageBydir("查询错误,请重试!");
            }
        }
        private void dgbind(string strGoodsName)
        {
            if (strGoodsName != "货品")
            {
                Hashtable htapp   = (Hashtable)Application["appconf"];
                string    strcons = (string)htapp["cons"];
                StoBusi = new BusiComm.StorageBusi(strcons);
                DataTable dtout = StoBusi.GetGoodsToProvider(strGoodsName);
                if (dtout == null)
                {
                    this.SetErrorMsgPageBydir("查询出错,请重试!");
                    return;
                }
                else
                {
                    dtout.TableName = "货品对应供应商清单";
                    DataTable dtexcel = dtout.Copy();
                    Session["QUERY"] = dtout;
                }

                UcPageView1.MyDataGrid.PageSize = 10;
                DataView dvOut = new DataView(dtout);
                this.UcPageView1.MyDataSource = dvOut;
                this.UcPageView1.BindGrid();
            }
        }
//		private void Checking()
//		{
//			string strPoID=this.txtPoID.Text.Trim();
//			Hashtable htapp=(Hashtable)Application["appconf"];
//			string strcons=(string)htapp["cons"];
//			StoBusi=new BusiComm.StorageBusi(strcons);
//			try
//			{
//				CMSMStruct.LoginStruct ls1=(CMSMStruct.LoginStruct)Session["Login"];
//				if(StoBusi.IsExistPoStockDetailStateUncheck(strPoID))
//				{
//					this.Popup("该采购订单下还有未审核通过的子订单,请先审核子订单!");
//					return;
//				}
//
//				if(StoBusi.PoSotckMainChecked(strPoID,ls1.strOperName))
//				{
//					this.SetSuccMsgPageBydir("采购订单完整审核成功!","Storage/wfmPoStock.aspx");
//					return;
//				}
//				else
//				{
//					this.SetErrorMsgPageBydir("采购订单完整审核时发生错误,请重试!");
//					return;
//				}
//			}
//			catch(Exception er)
//			{
//				this.clog.WriteLine(er);
//				this.SetErrorMsgPageBydir("查询错误,请重试!");
//				return;
//			}
//		}

        private void Execing()
        {
            string    strPoID = this.txtPoID.Text.Trim();
            Hashtable htapp   = (Hashtable)Application["appconf"];
            string    strcons = (string)htapp["cons"];

            StoBusi = new BusiComm.StorageBusi(strcons);
            try
            {
                if (!StoBusi.IsExistPoStockDetailStock(strPoID))
                {
                    this.Popup("该订单下没有任何明细,请添加订单明细!");
                    return;
                }
                if (StoBusi.PoSotckMainExecing(strPoID))
                {
                    this.SetSuccMsgPageBydir("采购订单开始执行成功!", "Storage/wfmPoStock.aspx");
                    return;
                }
                else
                {
                    this.SetErrorMsgPageBydir("采购订单开始执行时发生错误,请重试!");
                    return;
                }
            }
            catch (Exception er)
            {
                this.clog.WriteLine(er);
                this.SetErrorMsgPageBydir("查询错误,请重试!");
                return;
            }
        }
Exemple #15
0
        protected DataTable Query(string strDept, string strAcctMonth)
        {
            DataTable dtout   = new DataTable();
            Hashtable htapp   = (Hashtable)Application["appconf"];
            string    strcons = (string)htapp["cons"];

            StoBusi = new BusiComm.StorageBusi(strcons);
            StoBusi = new BusiComm.StorageBusi(strcons);
            try
            {
                dtout = StoBusi.GetDailySaleChart(strAcctMonth, strDept);
                if (dtout == null)
                {
                    this.Popup("查询出错,请重试!");
                    return(dtout);
                }
                else
                {
                    return(dtout);
                }
            }
            catch (Exception)
            {
                this.Popup("查询错误,请重试!");
                return(dtout);
            }
        }
Exemple #16
0
//		private void DataGrid1_CancelCommand(object source, DataGridCommandEventArgs e)
//		{
//			this.DataGrid1.EditItemIndex=-1;
//			this.DataGrid1.DataSource=(DataTable)Session["QUERY"];
//			this.DataGrid1.DataBind();
//		}
//
//		private void DataGrid1_EditCommand(object source, DataGridCommandEventArgs e)
//		{
//			this.DataGrid1.EditItemIndex=e.Item.ItemIndex;
//			this.DataGrid1.DataSource=(DataTable)Session["QUERY"];
//			this.DataGrid1.DataBind();
//		}
//
//		private void DataGrid1_UpdateCommand(object source, DataGridCommandEventArgs e)
//		{
//			DataTable dttmp=(DataTable)Session["QUERY"];
//			Session.Remove("QUERY");
//			double SystemCount=Math.Round(double.Parse(e.Item.Cells[13].Text),2);
//			double RealCount=Math.Round(double.Parse(((TextBox)e.Item.Cells[14].Controls[0]).Text.Trim()),2);
//
//			dttmp.Rows[e.Item.ItemIndex]["cnnRealCount"]=RealCount.ToString();
//			dttmp.Rows[e.Item.ItemIndex]["cnnDifferentCount"]=(SystemCount-RealCount).ToString();
//			Session["QUERY"]=dttmp;
//			this.DataGrid1.EditItemIndex=-1;
//			this.DataGrid1.DataSource=(DataTable)Session["QUERY"];
//			this.DataGrid1.DataBind();
//		}

        private void btnCheckOk_Click(object sender, System.EventArgs e)
        {
            if (this.Textbox2.Text.Trim() == "")
            {
                this.SetErrorMsgPageBydirHistory("Å̵ãÈ˲»ÄÜΪ¿Õ£¡");
                return;
            }

            string strDeptID      = this.ddlDept.SelectedValue;
            string strDate        = DateTime.Now.ToShortDateString();
            string strWeather     = this.Textbox1.Text.Trim();
            string strCheckOper   = this.Textbox2.Text.Trim();
            string strManager     = this.Textbox3.Text.Trim();
            string strProductType = this.ddlProductType.SelectedValue;

            CMSMStruct.LoginStruct ls1 = (CMSMStruct.LoginStruct)Session["Login"];
            string strOperDate         = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString();

            Hashtable htPara = new Hashtable();

            htPara.Add("strDeptID", strDeptID);
            htPara.Add("strDate", strDate);
            htPara.Add("strWeather", strWeather);
            htPara.Add("strCheckOper", strCheckOper);
            htPara.Add("strManager", strManager);
            htPara.Add("strOperName", ls1.strOperName);
            htPara.Add("strOperDate", strOperDate);
            htPara.Add("strProductType", strProductType);

            Hashtable htapp   = (Hashtable)Application["appconf"];
            string    strcons = (string)htapp["cons"];

            StoBusi = new BusiComm.StorageBusi(strcons);
            try
            {
                if (StoBusi.DayCheckFinal(htPara, (DataTable)Session["QUERY"]))
                {
                    this.DataGrid1.Columns[14].Visible = true;
                    this.DataGrid1.Columns[15].Visible = false;
                    this.btnCheckOk.Enabled            = false;
                    this.btnEdit.Enabled = false;
                    this.btnEdit.Text    = "±à¼­";
                    this.SetSuccMsgPageBydir("Å̵ã³É¹¦£¡", "Storage/wfmSaleDailyCheck.aspx");
                    return;
                }
                else
                {
                    this.SetErrorMsgPageBydir("Å̵ãʱ·¢Éú´íÎó£¬ÇëÖØÊÔ£¡");
                    return;
                }
            }
            catch (Exception er)
            {
                this.clog.WriteLine(er);
                this.SetErrorMsgPageBydir("²éѯ´íÎó£¬ÇëÖØÊÔ£¡");
                return;
            }
        }
        private void btMod_Click(object sender, System.EventArgs e)
        {
            CMSMStruct.LoginStruct       ls1  = (CMSMStruct.LoginStruct)Session["Login"];
            CMSMStruct.PoStockMainStruct psm1 = new CMSMStruct.PoStockMainStruct();
            psm1.strPoID      = this.txtPoID.Text.Trim();
            psm1.strPrvdCode  = this.ddlProvider.SelectedValue;
            psm1.strAddress   = this.txtAddress.Text.Trim();
            psm1.strComments  = this.txtComments.Text.Trim();
            psm1.strPlanCycle = this.txtPlanCycle.Text.Trim();
            psm1.strModer     = ls1.strOperName;

            if (psm1.strPoID == "" || psm1.strPoID.Length != 13)
            {
                this.Popup("采购订单号不正确!");
                return;
            }
            if (psm1.strPrvdCode == "")
            {
                this.Popup("供应商不能为空!");
                return;
            }
            if (psm1.strPlanCycle == "")
            {
                this.Popup("采购周期不能为空!");
                return;
            }

            CMSMStruct.PoStockMainStruct psmold = (CMSMStruct.PoStockMainStruct)Session["psmold"];
            Hashtable htapp   = (Hashtable)Application["appconf"];
            string    strcons = (string)htapp["cons"];

            StoBusi = new BusiComm.StorageBusi(strcons);
            try
            {
                if ((psm1.strPrvdCode != psmold.strPrvdCode || psm1.strPlanCycle != psmold.strPlanCycle) && StoBusi.IsExistPoProviderCycle(psm1.strPrvdCode, psm1.strPlanCycle))
                {
                    this.Popup("该供应商在本采购周期下已经有订单,不能修改!");
                    return;
                }

                if (StoBusi.ModPoSotckMainInfo(psm1, psmold))
                {
                    this.SetSuccMsgPageBydir("修改采购订单主表内容成功!", "Storage/wfmPoStock.aspx");
                    return;
                }
                else
                {
                    this.SetErrorMsgPageBydir("修改采购订单主表内容时发生错误,请重试!");
                    return;
                }
            }
            catch (Exception er)
            {
                this.clog.WriteLine(er);
                this.SetErrorMsgPageBydir("查询错误,请重试!");
                return;
            }
        }
Exemple #18
0
        private void DataGrid2_DeleteCommand(object source, DataGridCommandEventArgs e)
        {
            if (e.CommandName == "Delete")
            {
                string    strReceiveID    = e.Item.Cells[0].Text;
                DataTable dtSendReceiveID = (DataTable)Session["SendReceiveID"];
                for (int s = 0; s < dtSendReceiveID.Rows.Count; s++)
                {
                    if (dtSendReceiveID.Rows[s]["cnnReceiveSerialNo"].ToString() == strReceiveID)
                    {
                        dtSendReceiveID.Rows[s].Delete();
                        break;
                    }
                }

                Session.Remove("SendReceiveID");
                Session["SendReceiveID"] = dtSendReceiveID;

                Hashtable htapp   = (Hashtable)Application["appconf"];
                string    strcons = (string)htapp["cons"];
                StoBusi = new BusiComm.StorageBusi(strcons);
                try
                {
                    DataTable dtout = StoBusi.GetBillOfReceiveTempDetail(dtSendReceiveID);
                    if (dtout == null)
                    {
                        this.SetErrorMsgPageBydir("查询出错,请重试!");
                        return;
                    }
                    else
                    {
                        dtout.TableName = "领料单";
                        Session.Remove("SendReceiveDetail");
                        Session["SendReceiveDetail"] = dtout;
                        if (dtout.Rows.Count > 0)
                        {
                            this.btnPrint.Enabled = true;
                        }
                        else
                        {
                            this.btnPrint.Enabled = false;
                        }
                    }

                    this.DataGrid2.DataSource = (DataTable)Session["SendReceiveID"];
                    this.DataGrid2.DataBind();

                    this.DataGrid3.DataSource = (DataTable)Session["SendReceiveDetail"];
                    this.DataGrid3.DataBind();
                }
                catch (Exception er)
                {
                    this.clog.WriteLine(er);
                    this.SetErrorMsgPageBydir("查询错误,请重试!");
                    return;
                }
            }
        }
        protected void btMod_Click(object sender, System.EventArgs e)
        {
            string strProductCode = this.txtProductCode.Text.Trim();
            string strProductName = this.txtProductName.Text.Trim();
            string strUnit        = this.txtUnit.Text.Trim();
            string strBatch       = this.ddlBatch.SelectedValue;
            string strStartDate   = strBeginDate;
            string strCount       = this.txtCount.Text.Trim();
            string strSumFee      = this.txtSumFee.Text.Trim();
            string strMonth       = this.txtMonth.Text.Trim();

            if (strCount == "" || !Regex.IsMatch(strCount, @"^[+|-]{0,1}(\d*)\.{0,1}\d{0,}$"))
            {
                this.SetErrorMsgPageBydirHistory("数量必须是数字!");
                return;
            }
            if (strSumFee == "" || !Regex.IsMatch(strSumFee, @"^[+|-]{0,1}(\d*)\.{0,1}\d{0,}$"))
            {
                this.SetErrorMsgPageBydirHistory("费用必须是数字!");
                return;
            }

            Hashtable htpara = new Hashtable();

            htpara.Add("strProductCode", strProductCode);
            htpara.Add("strProductName", strProductName);
            htpara.Add("strUnit", strUnit);
            htpara.Add("strBatch", strBatch);
            htpara.Add("strStartDate", strStartDate);
            htpara.Add("strCount", strCount);
            htpara.Add("strSumFee", strSumFee);
            htpara.Add("strMonth", strMonth);

            Hashtable htapp   = (Hashtable)Application["appconf"];
            string    strcons = (string)htapp["cons"];

            StoBusi = new BusiComm.StorageBusi(strcons);
            try
            {
                if (StoBusi.UpdateSotckPlanBatch(htpara))
                {
                    this.SetSuccMsgPageBydir("修改成功!", "Storage/wfmStockPlan.aspx");
                    return;
                }
                else
                {
                    this.SetErrorMsgPageBydir("修改采购计划时发生错误,请重试!");
                    return;
                }
            }
            catch (Exception er)
            {
                this.clog.WriteLine(er);
                this.SetErrorMsgPageBydir("查询错误,请重试!");
                return;
            }
        }
        private void btAdd_Click(object sender, System.EventArgs e)
        {
            CMSMStruct.ProviderStruct ps1 = new CMSMStruct.ProviderStruct();
            ps1.strPrvdCode          = this.txtProviderCode.Text.Trim();
            ps1.strPrvdName          = this.txtProviderName.Text.Trim();
            ps1.strPrvdAbbName       = this.txtProviderAbbName.Text.Trim();
            ps1.strPrvdCredit        = this.ddlCredit.SelectedValue;
            ps1.strPrvdQualification = this.txtQualification.Text.Trim();
            ps1.strActiveFlag        = this.ddlActiveFlag.SelectedValue;
            ps1.strPrvdLinkName      = this.txtLinkName.Text.Trim();
            ps1.strPrvdPhone         = this.txtLinkPhone.Text.Trim();
            ps1.strPrvdFax           = this.txtFax.Text.Trim();
            ps1.strPrvdEmail         = this.txtEmail.Text.Trim();
            ps1.strPostCode          = this.txtPostCode.Text.Trim();
            ps1.strAddress           = this.txtAddress.Text.Trim();
            CMSMStruct.LoginStruct ls1 = (CMSMStruct.LoginStruct)Session["Login"];
            ps1.strPrvdCreater = ls1.strOperName;
            ps1.strOperName    = ls1.strOperName;

            if (ps1.strPrvdName == "" || ps1.strPrvdName.Length > 20)
            {
                this.Popup("供应商名称不能为空或长度过长!");
                return;
            }

            Hashtable htapp   = (Hashtable)Application["appconf"];
            string    strcons = (string)htapp["cons"];

            StoBusi = new BusiComm.StorageBusi(strcons);
            try
            {
                string strcount = StoBusi.IsExistProvider(ps1.strPrvdName);
                if (strcount != "0")
                {
                    this.Popup("该供应商名称已经存在,请使用不同的名称!");
                    return;
                }

                if (StoBusi.NewProviderAdd(ps1))
                {
                    this.SetSuccMsgPageBydir("新增供应商档案成功!", "Storage/wfmProviderDetail.aspx");
                    return;
                }
                else
                {
                    this.SetErrorMsgPageBydir("新增供应商档案时发生错误,请重试!");
                    return;
                }
            }
            catch (Exception er)
            {
                this.clog.WriteLine(er);
                this.SetErrorMsgPageBydir("查询错误,请重试!");
                return;
            }
        }
        private void DataGrid1_UpdateCommand(object source, DataGridCommandEventArgs e)
        {
            DataTable dttmp = (DataTable)Session["QUERY"];

            Session.Remove("QUERY");
            double    StatdardSafeLowCount = Math.Round(double.Parse(((TextBox)e.Item.Cells[6].Controls[0]).Text.Trim()), 2);
            double    StatdardSafeUpCount  = Math.Round(double.Parse(((TextBox)e.Item.Cells[7].Controls[0]).Text.Trim()), 2);
            string    strProductCode       = e.Item.Cells[2].Text.Trim();
            DataTable dtproduct            = (DataTable)Application["AllMaterial"];
            DataView  dview = dtproduct.DefaultView;

            dview.RowFilter = "vcCommCode='" + strProductCode + "'";
            double StatdardCount = Math.Round(double.Parse(dview[0]["cnnStatdardCount"].ToString()), 2);
            double SafeLowCount  = Math.Round(StatdardSafeLowCount * StatdardCount, 2);
            double SafeUpCount   = Math.Round(StatdardSafeUpCount * StatdardCount, 2);

            CMSMStruct.LoginStruct ls1 = (CMSMStruct.LoginStruct)Session["Login"];
            string    strDeptID        = e.Item.Cells[0].Text.Trim();
            Hashtable htPara           = new Hashtable();

            htPara.Add("strDeptID", strDeptID);
            htPara.Add("strProductCode", strProductCode);
            htPara.Add("SafeLowCount", SafeLowCount.ToString());
            htPara.Add("SafeUpCount", SafeUpCount.ToString());
            htPara.Add("strOperName", ls1.strOperName);
            htPara.Add("strOperDate", DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString());

            Hashtable htapp   = (Hashtable)Application["appconf"];
            string    strcons = (string)htapp["cons"];

            StoBusi = new BusiComm.StorageBusi(strcons);
            try
            {
                if (StoBusi.UpdateProductSafeCount(htPara))
                {
                    dttmp.Rows[e.Item.ItemIndex]["cnnSafeCount"]   = StatdardSafeLowCount.ToString();
                    dttmp.Rows[e.Item.ItemIndex]["cnnSafeUpCount"] = StatdardSafeUpCount.ToString();
                    Session["QUERY"]             = dttmp;
                    this.DataGrid1.EditItemIndex = -1;
                    this.DataGrid1.DataSource    = (DataTable)Session["QUERY"];
                    this.DataGrid1.DataBind();
                }
                else
                {
                    this.SetErrorMsgPageBydir("更新安全库存失败!");
                    return;
                }
            }
            catch (Exception er)
            {
                this.clog.WriteLine(er);
                this.SetErrorMsgPageBydir("查询错误,请重试!");
                return;
            }
        }
        protected void btnQuery_Click(object sender, System.EventArgs e)
        {
            strBeginDate = Request.Form["txtBegin"].ToString();
            strEndDate   = Request.Form["txtEnd"].ToString();
            if (strBeginDate == "" || strEndDate == "" || strBeginDate == null || strEndDate == null)
            {
                this.SetErrorMsgPageBydir("时间不能为空,请重新选择时间!");
                return;
            }

            string strProviderID = this.ddlProvider.SelectedValue;

            if (strProviderID == "")
            {
                this.SetErrorMsgPageBydir("供应商不能为空!");
                return;
            }

            Hashtable htPara = new Hashtable();

            htPara.Add("strProviderID", strProviderID);
            htPara.Add("strBeginDate", strBeginDate);
            htPara.Add("strEndDate", strEndDate);

            Hashtable htapp   = (Hashtable)Application["appconf"];
            string    strcons = (string)htapp["cons"];

            StoBusi = new BusiComm.StorageBusi(strcons);
            try
            {
                DataTable dtout = StoBusi.GetBillOfEnterStorage(htPara);
                if (dtout == null)
                {
                    this.SetErrorMsgPageBydir("查询出错,请重试!");
                    return;
                }
                else
                {
                    dtout.TableName  = "进仓单";
                    Session["QUERY"] = dtout;
                }

                UcPageView1.MyDataGrid.PageSize = 20;
                DataView dvOut = new DataView(dtout);
                this.UcPageView1.MyDataSource = dvOut;
                this.UcPageView1.BindGrid();
            }
            catch (Exception er)
            {
                this.clog.WriteLine(er);
                this.SetErrorMsgPageBydir("查询错误,请重试!");
                return;
            }
        }
        private void btnValidEnter_Click(object sender, System.EventArgs e)
        {
            if (this.lblAssignID.Text.Trim() == "")
            {
                this.SetErrorMsgPageBydir("生产序号错误,请重新查询!");
                return;
            }

            DataTable dtIn = (DataTable)Session["QUERY"];

            if (dtIn == null || dtIn.Rows.Count == 0)
            {
                this.SetErrorMsgPageBydirHistory("没有任何需要验收的分货单内容,请检查生产序号是否正确!");
                return;
            }

            string strDeptID      = this.ddlValidDept.SelectedValue;
            string strAssignID    = this.lblAssignID.Text.Trim();
            string strReceiveOper = this.txtReceiveOper.Text.Trim();
            string strValidDate   = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString();

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

            htPara.Add("strDeptID", strDeptID);
            htPara.Add("strAssignID", strAssignID);
            htPara.Add("strReceiveOper", strReceiveOper);
            htPara.Add("strValidDate", strValidDate);
            htPara.Add("strOperID", ls1.strOperName);

            Hashtable htapp   = (Hashtable)Application["appconf"];
            string    strcons = (string)htapp["cons"];

            StoBusi = new BusiComm.StorageBusi(strcons);
            try
            {
                if (StoBusi.AssignToValidEnterFinal(htPara, dtIn))
                {
                    this.SetSuccMsgPageBydir("订单验收入库成功!", "Storage/wfmBillValidEnter.aspx");
                    return;
                }
                else
                {
                    this.SetErrorMsgPageBydir("订单验收入库时发生错误,请重试!");
                    return;
                }
            }
            catch (Exception er)
            {
                this.clog.WriteLine(er);
                this.SetErrorMsgPageBydir("查询错误,请重试!");
                return;
            }
        }
        private void btMod_Click(object sender, System.EventArgs e)
        {
            CMSMStruct.ProviderStruct ps1 = new CMSMStruct.ProviderStruct();
            ps1.strPrvdCode          = this.txtProviderCode.Text.Trim();
            ps1.strPrvdName          = this.txtProviderName.Text.Trim();
            ps1.strPrvdAbbName       = this.txtProviderAbbName.Text.Trim();
            ps1.strAddress           = this.txtAddress.Text.Trim();
            ps1.strPostCode          = this.txtPostCode.Text.Trim();
            ps1.strPrvdPhone         = this.txtLinkPhone.Text.Trim();
            ps1.strPrvdFax           = this.txtFax.Text.Trim();
            ps1.strPrvdEmail         = this.txtEmail.Text.Trim();
            ps1.strPrvdLinkName      = this.txtLinkName.Text.Trim();
            ps1.strPrvdCredit        = this.ddlCredit.SelectedValue;
            ps1.strPrvdQualification = this.txtQualification.Text.Trim();
            ps1.strActiveFlag        = this.ddlActiveFlag.SelectedValue;
            CMSMStruct.LoginStruct ls1 = (CMSMStruct.LoginStruct)Session["Login"];
            ps1.strOperName = ls1.strOperName;

            if (ps1.strPrvdCode == "" || ps1.strPrvdCode.Length >= 10)
            {
                this.SetErrorMsgPageBydirHistory("供应商编码不能为空或长度过长!");
                return;
            }
            if (ps1.strPrvdName == "" || ps1.strPrvdName.Length > 20)
            {
                this.SetErrorMsgPageBydirHistory("供应商名称不能为空或长度过长!");
                return;
            }

            CMSMStruct.ProviderStruct psold = (CMSMStruct.ProviderStruct)Session["psold"];
            Hashtable htapp   = (Hashtable)Application["appconf"];
            string    strcons = (string)htapp["cons"];

            StoBusi = new BusiComm.StorageBusi(strcons);
            try
            {
                if (StoBusi.ModProviderInfo(ps1, psold))
                {
                    this.SetSuccMsgPageBydir("修改供应商资料成功!", "Storage/wfmProvider.aspx");
                    return;
                }
                else
                {
                    this.SetErrorMsgPageBydir("修改供应商资料时发生错误,请重试!");
                    return;
                }
            }
            catch (Exception er)
            {
                this.clog.WriteLine(er);
                this.SetErrorMsgPageBydir("查询错误,请重试!");
                return;
            }
        }
Exemple #25
0
        private void DBBind()
        {
            string strPoID = this.txtPoID.Text.Trim();

            Hashtable htapp   = (Hashtable)Application["appconf"];
            string    strcons = (string)htapp["cons"];

            StoBusi = new BusiComm.StorageBusi(strcons);
            try
            {
                DataSet dsout = StoBusi.GetPoStockDetailSum(strPoID);
                if (dsout == null)
                {
                    this.SetErrorMsgPageBydir("查询出错,请重试!");
                    return;
                }
                else
                {
                    this.TableConvert(dsout.Tables["detail"], "cnvcDeptName", "NewDept");
                    this.TableConvert(dsout.Tables["detail"], "cnvcRowState", "tbNameCodeToStorage", "vcCommSign='PoState'");
                    this.TableConvert(dsout.Tables["detail"], "cnvcGroupName", "ComputationGroup");
                    this.TableConvert(dsout.Tables["detail"], "cnvcStockUnit", "ComputationUnit");
                    Session["podetailtomod"] = dsout.Tables["detail"];
                    DataView dvOut1 = new DataView(dsout.Tables["detail"]);
                    this.Datagrid2.PageSize      = 10;
                    this.Datagrid2.EditItemIndex = -1;
                    this.Datagrid2.DataSource    = dvOut1;
                    this.Datagrid2.DataBind();
                    foreach (DataGridItem dgi in this.Datagrid2.Items)
                    {
                        if (dgi.Cells[13].Text.Trim() == "完成")
                        {
                            ((Button)dgi.Cells[19].Controls[0]).Visible = false;
                            ((Button)dgi.Cells[20].Controls[0]).Visible = false;
                        }
                    }

                    this.TableConvert(dsout.Tables["sum"], "计量单位组", "ComputationGroup");
                    this.TableConvert(dsout.Tables["sum"], "单位", "ComputationUnit");
                    UcPageView1.MyDataGrid.Caption  = "采购订单汇总表";
                    UcPageView1.MyDataGrid.PageSize = 20;
                    DataView dvOut2 = new DataView(dsout.Tables["sum"]);
                    this.UcPageView1.MyDataSource = dvOut2;
                    this.UcPageView1.BindGrid();
                }
            }
            catch (Exception er)
            {
                this.clog.WriteLine(er);
                this.SetErrorMsgPageBydir("查询错误,请重试!");
                return;
            }
        }
Exemple #26
0
        private void btnQuery_Click(object sender, System.EventArgs e)
        {
            string strSendSerial = this.txtSendSerial.Text.Trim();

            if (strSendSerial == "")
            {
                this.SetErrorMsgPageBydirHistory("出货单号不能为空!");
                return;
            }

            DataTable dtSendLog = new DataTable("dtSendLog");

            dtSendLog.Columns.Add("cnnSendSerialNo");
            DataRow dr = dtSendLog.NewRow();

            dr["cnnSendSerialNo"] = strSendSerial;
            dtSendLog.Rows.Add(dr);

            Hashtable htapp   = (Hashtable)Application["appconf"];
            string    strcons = (string)htapp["cons"];

            StoBusi = new BusiComm.StorageBusi(strcons);
            try
            {
                DataTable dtout = StoBusi.GetBillOfReceiveSendPrint(strSendSerial);
                if (dtout == null)
                {
                    this.btnPrint.Enabled = false;
                    this.SetErrorMsgPageBydir("查询出错,请重试!");
                    return;
                }
                else
                {
                    dtout.TableName = "dtSendDetail";
                    Session.Remove("BillPrint");
                    DataSet dsout = new DataSet("领料发货单");
                    dsout.Tables.Add(dtout.Copy());
                    dsout.Tables.Add(dtSendLog);
                    Session["BillPrint"]  = dsout;
                    this.btnPrint.Enabled = true;
                }

                this.DataGrid1.DataSource = dtout;
                this.DataGrid1.DataBind();
            }
            catch (Exception er)
            {
                this.clog.WriteLine(er);
                this.SetErrorMsgPageBydir("查询错误,请重试!");
                return;
            }
        }
Exemple #27
0
        protected void btnBatchConfirm_Click(object sender, System.EventArgs e)
        {
            CheckBox chk1;
            string   strserial    = "";
            int      confirmcount = 0;

            foreach (DataGridItem oitem in this.DataGrid1.Items)
            {
                chk1 = (CheckBox)oitem.FindControl("chkLose");
                if (chk1.Checked)
                {
                    strserial += oitem.Cells[1].Text.Trim() + ",";
                    confirmcount++;
                }
            }

            if (strserial.Length > 0)
            {
                strserial = strserial.Substring(0, strserial.Length - 1);
                string strConfirmOper = this.txtConfirmOper.Text.Trim();
                string strConfirmDate = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString();

                Hashtable htPara = new Hashtable();
                htPara.Add("strLoseSerial", strserial);
                htPara.Add("strConfirmOper", strConfirmOper);
                htPara.Add("strConfirmDate", strConfirmDate);

                Hashtable htapp   = (Hashtable)Application["appconf"];
                string    strcons = (string)htapp["cons"];
                StoBusi = new BusiComm.StorageBusi(strcons);
                try
                {
                    if (StoBusi.UpdateLoseConfirm(htPara))
                    {
                        this.SetSuccMsgPageBydir("损耗确认成功,本次共确认:" + confirmcount.ToString() + "条损耗记录!", "Storage/wfmDestroyConfirm.aspx");
                        return;
                    }
                    else
                    {
                        this.SetErrorMsgPageBydir("损耗确认失败,请重试!");
                        return;
                    }
                }
                catch (Exception er)
                {
                    this.clog.WriteLine(er);
                    this.SetErrorMsgPageBydir("查询错误,请重试!");
                    return;
                }
            }
        }
        private void btnQuery_Click(object sender, System.EventArgs e)
        {
            string strDeptID   = this.ddlValidDept.SelectedValue;
            string strAssignID = this.txtAssignID.Text.Trim();

            if (strAssignID == "")
            {
                this.SetErrorMsgPageBydirHistory("生产序号不能为空!");
                return;
            }

            Hashtable htPara = new Hashtable();

            htPara.Add("strDeptID", strDeptID);
            htPara.Add("strAssignID", strAssignID);

            Hashtable htapp   = (Hashtable)Application["appconf"];
            string    strcons = (string)htapp["cons"];

            StoBusi = new BusiComm.StorageBusi(strcons);
            try
            {
                DataTable dtout = StoBusi.GetAssignToValidEnter(htPara);
                if (dtout == null)
                {
                    this.lblAssignID.Text = "";
                    this.SetErrorMsgPageBydir("查询出错,请重试!");
                    return;
                }
                else
                {
                    this.TableConvert(dtout, "cnvcShipDeptID", "NewDept");
                    this.TableConvert(dtout, "cnvcProductType", "tbNameCodeToStorage", "vcCommSign='PRODUCTTYPE'");
                    this.lblAssignID.Text = strAssignID;
                    dtout.TableName       = "验收信息表";
                    DataTable dtexcel = dtout.Copy();
                    Session["QUERY"] = dtout;
                }

                //				this.DataGrid1.PageSize = 30;
                this.DataGrid1.DataSource = dtout;
                this.DataGrid1.DataBind();
            }
            catch (Exception er)
            {
                this.lblAssignID.Text = "";
                this.clog.WriteLine(er);
                this.SetErrorMsgPageBydir("查询错误,请重试!");
                return;
            }
        }
Exemple #29
0
        protected void btnQuery_Click(object sender, System.EventArgs e)
        {
            strBeginDate = Request.Form["txtBegin"].ToString();
            strEndDate   = Request.Form["txtEnd"].ToString();
            if (strBeginDate == "" || strEndDate == "" || strBeginDate == null || strEndDate == null)
            {
                this.SetErrorMsgPageBydir("时间不能为空,请重新选择时间!");
                return;
            }

            string strOutDept = this.ddlOutDept.SelectedValue;
            string strInDept  = this.ddlInDept.SelectedValue;

            Hashtable htPara = new Hashtable();

            htPara.Add("strOutDept", strOutDept);
            htPara.Add("strInDept", strInDept);
            htPara.Add("strBeginDate", strBeginDate);
            htPara.Add("strEndDate", strEndDate);

            Hashtable htapp   = (Hashtable)Application["appconf"];
            string    strcons = (string)htapp["cons"];

            StoBusi = new BusiComm.StorageBusi(strcons);
            try
            {
                DataTable dtout = StoBusi.GetProductMoveLog(htPara);
                if (dtout == null)
                {
                    this.SetErrorMsgPageBydir("查询出错,请重试!");
                    return;
                }
                else
                {
                    this.TableConvert(dtout, "cnvcOutDeptID", "NewDept", "vcCommSign='SalesRoom'");
                    this.TableConvert(dtout, "cnvcInDeptID", "NewDept", "vcCommSign='SalesRoom'");
                    this.TableConvert(dtout, "cnvcBillState", "tbNameCodeToStorage", "vcCommSign='MOVE_OS'");
                    dtout.TableName = "调拨单";
                }

                this.DataGrid1.DataSource = dtout;
                this.DataGrid1.DataBind();
            }
            catch (Exception er)
            {
                this.clog.WriteLine(er);
                this.SetErrorMsgPageBydir("查询错误,请重试!");
                return;
            }
        }
        protected void btQuery_Click(object sender, System.EventArgs e)
        {
            Session.Remove("QUERY");
            strBeginDate = Request.Form["txtBegin"].ToString();
            strEndDate   = Request.Form["txtEnd"].ToString();
            if (strBeginDate == "" || strEndDate == "" || strBeginDate == null || strEndDate == null)
            {
                this.SetErrorMsgPageBydir("时间不能为空,请重新选择时间!");
                return;
            }

            string strDeptID   = this.ddlDept.SelectedValue;
            string strLoseType = this.ddlLoseType.SelectedValue;

            Hashtable htPara = new Hashtable();

            htPara.Add("strDeptID", strDeptID);
            htPara.Add("strBeginDate", strBeginDate);
            htPara.Add("strEndDate", strEndDate);
            htPara.Add("strLoseType", strLoseType);

            Hashtable htapp   = (Hashtable)Application["appconf"];
            string    strcons = (string)htapp["cons"];

            StoBusi = new BusiComm.StorageBusi(strcons);
            try
            {
                DataTable dtout = StoBusi.GetLoseDaySale(htPara);
                if (dtout == null)
                {
                    this.SetErrorMsgPageBydir("查询出错,请重试!");
                    return;
                }
                else
                {
                    dtout.TableName  = "销售报损表";
                    Session["QUERY"] = dtout;
                }

                this.DataGrid1.PageSize   = 20;
                this.DataGrid1.DataSource = dtout;
                this.DataGrid1.DataBind();
            }
            catch (Exception er)
            {
                this.clog.WriteLine(er);
                this.SetErrorMsgPageBydir("查询错误,请重试!");
                return;
            }
        }