示例#1
0
        protected void Button4_Click(object sender, System.EventArgs e)
        {
            //刷新数据
            try
            {
                if (this.Label3.Text == "销售差异汇总表")
                {
                    DataTable dt = Helper.QueryLongTrans("Get_Dept_Dif '" + txtBeginDate.Text + "','" + txtEndDate.Text + "','" + ddlDept.SelectedValue + "'");

                    if (dt.Rows.Count > 0)
                    {
                        AMSApp.zhenghua.Entity.OperLog ol = new AMSApp.zhenghua.Entity.OperLog();
                        MaterialFacade mf = new MaterialFacade();
                        mf.BatchDifference(dt, ol);
                    }
                }
                else
                {
                    DataTable dt = Helper.QueryLongTrans("Get_Oper_Dif '" + txtBeginDate.Text + "','" + txtEndDate.Text + "','" + ddlDept.SelectedValue + "'");

                    if (dt.Rows.Count > 0)
                    {
                        AMSApp.zhenghua.Entity.OperLog ol = new AMSApp.zhenghua.Entity.OperLog();
                        MaterialFacade mf = new MaterialFacade();
                        mf.BatchDifference(dt, ol);
                    }
                }
                this.Popup("刷新数据成功!");
                Button3_Click(null, null);
            }
            catch (Exception ex)
            {
                this.Popup(ex.Message);
            }
        }
示例#2
0
		private void Button1_Click(object sender, System.EventArgs e)
		{
			//添加修改生产组
			//确定
			Entity.OperLog ol = new AMSApp.zhenghua.Entity.OperLog();
			ol.cnvcOperType = "添加生产组";
			ol.cnvcOperID = this.oper.strLoginID;
			ol.cnvcDeptID = this.oper.strDeptID;

			Business.WareHouseFacade whf = new WareHouseFacade();
			
			if(this.JudgeIsNull(this.txtTeamName.Text))
			{
				this.Popup("请输入生产组名称");
				return;
			}
			if(this.lblTitle.Text == "添加生产组")
			{
				ol.cnvcOperType = "添加生产组";
				Entity.Team team = new AMSApp.zhenghua.Entity.Team();
				team.cnvcTeamName = this.txtTeamName.Text;
				int ret = whf.AddTeam(ol,team);
				if(ret > 0 )
				{
					this.Popup("添加生产组成功!");
				}
				else
				{
					this.Popup("添加生产组失败!");
				}

				this.Response.Write("<script type=\"text/javascript\">window.returnValue=true;window.close()</script>");
			}
			if(this.lblTitle.Text == "修改生产组")
			{
				ol.cnvcOperType = "修改生产组";
				Entity.Team team = new AMSApp.zhenghua.Entity.Team();
				team.cnnTeamID = Convert.ToInt32(this.txtTeamID.Text);
				team.cnvcTeamName = this.txtTeamName.Text;
				int ret = whf.UpdateTeam(ol,team);
				if(ret > 0 )
				{
					this.Popup("修改生产组成功!");
				}
				else
				{
					this.Popup("修改生产组失败!");
				}

				this.Response.Write("<script type=\"text/javascript\">window.returnValue=true;window.close()</script>");
			}
		}
示例#3
0
        private void Button1_Click(object sender, System.EventArgs e)
        {
            Entity.OperLog ol = new AMSApp.zhenghua.Entity.OperLog();
            ol.cnvcOperType = "添加生产员";
            ol.cnvcOperID   = this.oper.strLoginID;
            ol.cnvcDeptID   = this.oper.strDeptID;

            Business.WareHouseFacade whf = new WareHouseFacade();

            if (this.JudgeIsNull(this.txtProducerName.Text))
            {
                this.Popup("请输入生产员名称");
                return;
            }
            if (this.lblTitle.Text == "添加生产员")
            {
                ol.cnvcOperType = "添加生产员";
                Entity.Producer producer = new AMSApp.zhenghua.Entity.Producer();
                producer.cnvcProducerName = this.txtProducerName.Text;
                int ret = whf.AddProducer(ol, producer);
                if (ret > 0)
                {
                    this.Popup("添加生产员成功!");
                }
                else
                {
                    this.Popup("添加生产员失败!");
                }

                this.Response.Write("<script type=\"text/javascript\">window.returnValue=true;window.close()</script>");
            }
            if (this.lblTitle.Text == "修改生产员")
            {
                ol.cnvcOperType = "修改生产员";
                Entity.Producer producer = new AMSApp.zhenghua.Entity.Producer();
                producer.cnnProducerID    = Convert.ToInt32(this.txtProducerID.Text);
                producer.cnvcProducerName = this.txtProducerName.Text;
                int ret = whf.UpdateProducer(ol, producer);
                if (ret > 0)
                {
                    this.Popup("修改生产员成功!");
                }
                else
                {
                    this.Popup("修改生产员失败!");
                }

                this.Response.Write("<script type=\"text/javascript\">window.returnValue=true;window.close()</script>");
            }
        }
示例#4
0
        private void Button1_Click(object sender, System.EventArgs e)
        {
            //删除计量单位组
            if (this.DataGrid1.SelectedIndex < 0)
            {
                this.Popup("请选择计量单位组");
                return;
            }
            string strgroupcode = this.DataGrid1.SelectedItem.Cells[0].Text;
            string strgroupname = this.DataGrid1.SelectedItem.Cells[1].Text;

            string    strsql            = "select * from tbcomputationunit where cnvcgroupcode='" + strgroupcode + "'";
            DataTable dtcomputationunit = Helper.Query(strsql);

            if (dtcomputationunit.Rows.Count > 0)
            {
                this.Popup("计量单位组已被使用无法删除!");
                return;
            }

            Entity.OperLog ol = new AMSApp.zhenghua.Entity.OperLog();
            ol.cnvcOperType = "删除计量单位组";
            ol.cnvcOperID   = this.oper.strLoginID;
            ol.cnvcDeptID   = this.oper.strDeptID;

            Entity.ComputationGroup cg = new Entity.ComputationGroup();
            cg.cnvcGroupCode = strgroupcode;
            cg.cnvcGroupName = strgroupname;

            Business.ComputationUnit bcu = new AMSApp.zhenghua.Business.ComputationUnit();
            int ret = bcu.DeleteComputationGroup(ol, cg);

            LoadGroup();
            if (ret > 0)
            {
                this.Popup("删除计量单位组成功!");
                LoadGroup();
            }
            else
            {
                this.Popup("删除计量单位组失败!");
            }
        }
示例#5
0
        private void Button2_Click(object sender, System.EventArgs e)
        {
            //删除计量单位
            if (this.DataGrid2.SelectedIndex >= 0)
            {
                Entity.OperLog ol = new AMSApp.zhenghua.Entity.OperLog();
                ol.cnvcOperType = "删除计量单位";
                ol.cnvcOperID   = this.oper.strLoginID;
                ol.cnvcDeptID   = this.oper.strDeptID;

                Entity.ComputationUnit cu = new AMSApp.zhenghua.Entity.ComputationUnit();
                cu.cnvcComunitCode = this.DataGrid2.SelectedItem.Cells[0].Text;

                //string strsql = "select * from tbcomputationunit where cnvccomunitcode='"+cu.cnvcComunitCode+"' and cnbmainunit=1";
                DataTable dt = Application["tbInventory"] as DataTable;
                DataView  dv = new DataView(dt);
                dv.RowFilter = "cnvcproduceunitcode='" + cu.cnvcComunitCode + "' or cnvcstcomunitcode='" + cu.cnvcComunitCode + "'";
                if (dv.Count > 0)
                {
                    this.Popup("不能删除已经使用中的计量单位");
                    return;
                }
                Business.ComputationUnit bcu = new AMSApp.zhenghua.Business.ComputationUnit();
                int ret = bcu.DeleteComputationUnit(ol, cu);

                DataGrid1_SelectedIndexChanged(null, null);
                if (ret > 0)
                {
                    this.Popup("删除计量单位成功!");
                    LoadGroup();
                }
                else
                {
                    this.Popup("删除计量单位失败!");
                }
            }
            else
            {
                this.Popup("请选择计量单位");
            }
        }
        private void Button1_Click(object sender, System.EventArgs e)
        {
            //确定
            Entity.OperLog ol = new AMSApp.zhenghua.Entity.OperLog();
            //ol.cnvcOperType = "添加存货档案";
            ol.cnvcOperID = this.oper.strLoginID;
            ol.cnvcDeptID = this.oper.strDeptID;


            Entity.Inventory inv = GetInv();

            Business.InventoryFacade binv = new InventoryFacade();

            if (this.JudgeIsNull(this.txtInvCode.Text))
            {
                this.Popup("存货编码获取错误,请重新打开此页面");
                return;
            }
            if (this.JudgeIsNull(this.txtInvName.Text))
            {
                this.Popup("请输入存货名称");
                return;
            }
//			if(this.JudgeIsNull(this.txtInvCCost.Text))
//			{
//				this.Popup("请输入参考成本");
//				return;
//			}
            if (!this.JudgeIsNum(this.txtInvCCost.Text))
            {
                this.Popup("参考成本请输入数字");
                return;
            }
            if (!this.JudgeIsNum(this.txtSafeNum.Text))
            {
                this.Popup("安全库存量请输入数字");
                return;
            }
            if (!this.JudgeIsNum(this.txtLowSum.Text))
            {
                this.Popup("最低库存量请输入数字");
                return;
            }
            if (!this.JudgeIsNum(this.txtExpire.Text))
            {
                this.Popup("过期限制请输入数字");
                return;
            }
            if (!this.JudgeIsNum(this.txtRetailPrice.Text))
            {
                this.Popup("零售价请输入数字");
                return;
            }
            if (this.lblTitle.Text == "添加存货档案")
            {
                //Entity.OperLog ol = new AMSApp.zhenghua.Entity.OperLog();
                ol.cnvcOperType = "添加存货档案";
//				ol.cnvcOperID = this.oper.strLoginID;
//				ol.cnvcDeptID = this.oper.strDeptID;
//
//
//				Entity.Inventory inv = GetInv();
//
//				Business.InventoryFacade binv = new InventoryFacade();
                int ret = binv.AddInventory(ol, inv);
                if (ret > 0)
                {
                    this.Popup("添加存货档案成功!");
                }
                else
                {
                    this.Popup("添加存货档案失败!");
                }

                this.Response.Write("<script type=\"text/javascript\">window.returnValue=true;window.close()</script>");
            }
            if (this.lblTitle.Text == "修改存货档案")
            {
                //Entity.OperLog ol = new AMSApp.zhenghua.Entity.OperLog();
                ol.cnvcOperType = "修改存货档案";
//				ol.cnvcOperID = this.oper.strLoginID;
//				ol.cnvcDeptID = this.oper.strDeptID;
//
//
//				Entity.Inventory inv = GetInv();
//
//				Business.InventoryFacade binv = new InventoryFacade();
                int ret = binv.UpdateInventory(ol, inv);
                if (ret > 0)
                {
                    this.Popup("修改存货档案成功!");
                }
                else
                {
                    this.Popup("修改存货档案失败!");
                }

                this.Response.Write("<script type=\"text/javascript\">window.returnValue=true;window.close()</script>");
            }
        }
        private void Button1_Click(object sender, System.EventArgs e)
        {
            //确定
            Entity.OperLog ol = new AMSApp.zhenghua.Entity.OperLog();
            ol.cnvcOperType = "添加存货档案";
            ol.cnvcOperID   = this.oper.strLoginID;
            ol.cnvcDeptID   = this.oper.strDeptID;


            Entity.Warehouse         wh  = this.GetWh();
            Business.WareHouseFacade whf = new WareHouseFacade();

            if (!this.JudgeIsNum(this.txtFrequency.Text))
            {
                this.Popup("盘点周期请输入数字");
                return;
            }
            if (this.JudgeIsNull(this.txtWhName.Text))
            {
                this.Popup("请输入仓库名称");
                return;
            }
            if (this.lblTitle.Text == "添加仓库档案")
            {
                //Entity.OperLog ol = new AMSApp.zhenghua.Entity.OperLog();
                ol.cnvcOperType = "添加存货档案";
//				ol.cnvcOperID = this.oper.strLoginID;
//				ol.cnvcDeptID = this.oper.strDeptID;
//
//
//				Entity.Warehouse wh = this.GetWh();
//				Business.WareHouseFacade whf = new WareHouseFacade();
                int ret = whf.AddWareHouse(ol, wh);
                if (ret > 0)
                {
                    this.Popup("添加仓库档案成功!");
                }
                else
                {
                    this.Popup("添加仓库档案失败!");
                }

                this.Response.Write("<script type=\"text/javascript\">window.returnValue=true;window.close()</script>");
            }
            if (this.lblTitle.Text == "修改仓库档案")
            {
                //Entity.OperLog ol = new AMSApp.zhenghua.Entity.OperLog();
                ol.cnvcOperType = "修改仓库档案";
//				ol.cnvcOperID = this.oper.strLoginID;
//				ol.cnvcDeptID = this.oper.strDeptID;
//
//
//				Entity.Warehouse wh = GetWh();
//
//				Business.WareHouseFacade whf = new WareHouseFacade();
                int ret = whf.UpdateWareHouse(ol, wh);
                if (ret > 0)
                {
                    this.Popup("修改仓库档案成功!");
                }
                else
                {
                    this.Popup("修改仓库档案失败!");
                }

                this.Response.Write("<script type=\"text/javascript\">window.returnValue=true;window.close()</script>");
            }
        }