Пример #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ZWL.Common.PublicMethod.CheckSession();
            ZWL.BLL.ERPBuyChanPin Model = new ZWL.BLL.ERPBuyChanPin();
            Model.GetModel(int.Parse(Request.QueryString["ID"].ToString()));
            this.lblOrderName.Text      = Model.OrderName.ToString();
            this.lblProductName.Text    = Model.ProductName.ToString();
            this.lblProductSerils.Text  = Model.ProductSerils.ToString();
            this.lblGongYingShang.Text  = Model.GongYingShang.ToString();
            this.lblProductType.Text    = Model.ProductType.ToString();
            this.lblXingHao.Text        = Model.XingHao.ToString();
            this.lblDanWei.Text         = Model.DanWei.ToString();
            this.lblDanJia.Text         = Model.DanJia.ToString();
            this.lblShuLiang.Text       = Model.ShuLiang.ToString();
            this.lblZongJia.Text        = Model.ZongJia.ToString();
            this.lblYiFuKuan.Text       = Model.YiFuKuan.ToString();
            this.lblQianKuanShu.Text    = Model.QianKuanShu.ToString();
            this.lblIFJiaoFu.Text       = Model.IFJiaoFu.ToString();
            this.lblChanPinMiaoShu.Text = Model.ChanPinMiaoShu.ToString();
            this.lblUserName.Text       = Model.UserName.ToString();
            this.lblTimeStr.Text        = Model.TimeStr.ToString();
            this.lblBackInfo.Text       = Model.BackInfo.ToString();

            //写系统日志
            ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi();
            MyRiZhi.UserName    = ZWL.Common.PublicMethod.GetSessionValue("UserName");
            MyRiZhi.DoSomething = "用户查看采购订单产品信息(" + this.lblOrderName.Text + ")";
            MyRiZhi.IpStr       = System.Web.HttpContext.Current.Request.UserHostAddress.ToString();
            MyRiZhi.Add();
        }
    }
Пример #2
0
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        ZWL.BLL.ERPBuyChanPin Model = new ZWL.BLL.ERPBuyChanPin();

        Model.ID             = int.Parse(Request.QueryString["ID"].ToString());
        Model.OrderName      = this.txtOrderName.Text.ToString();
        Model.ProductName    = this.txtProductName.Text.ToString();
        Model.ProductSerils  = this.txtProductSerils.Text.ToString();
        Model.GongYingShang  = this.txtGongYingShang.Text.ToString();
        Model.ProductType    = this.txtProductType.Text.ToString();
        Model.XingHao        = this.txtXingHao.Text.ToString();
        Model.DanWei         = this.txtDanWei.Text.ToString();
        Model.DanJia         = decimal.Parse(this.txtDanJia.Text);
        Model.ShuLiang       = decimal.Parse(this.txtShuLiang.Text);
        Model.ZongJia        = decimal.Parse(this.txtZongJia.Text);
        Model.YiFuKuan       = decimal.Parse(this.txtYiFuKuan.Text);
        Model.QianKuanShu    = decimal.Parse(this.txtQianKuanShu.Text);
        Model.IFJiaoFu       = this.RadioButtonList1.SelectedItem.Text;
        Model.ChanPinMiaoShu = this.txtChanPinMiaoShu.Text.ToString();
        Model.UserName       = this.txtUserName.Text.ToString();
        Model.TimeStr        = DateTime.Parse(this.txtTimeStr.Text);
        Model.BackInfo       = this.txtBackInfo.Text.ToString();


        if (this.RadioButtonList1.SelectedItem.Text == this.Label4.Text)
        {
            if (this.Label4.Text == "已交付")
            {
                //从产品库存中减去
                string TempSqlStr = "update ERPProduct set RuKuSum=RuKuSum-" + this.Label1.Text + "+" + this.txtShuLiang.Text + ",NowKuCun=NowKuCun-" + this.Label1.Text + "+" + this.txtShuLiang.Text + " where ProductName='" + this.txtProductName.Text.ToString() + "'";
                ZWL.DBUtility.DbHelperSQL.ExecuteSQL(TempSqlStr);
            }
        }
        else
        {
            if (this.Label4.Text == "已交付")
            {
                //从产品库存中退回原始状态
                string TempSqlStr = "update ERPProduct set RuKuSum=RuKuSum-" + this.Label1.Text + ",NowKuCun=NowKuCun-" + this.Label1.Text + " where ProductName='" + this.txtProductName.Text.ToString() + "'";
                ZWL.DBUtility.DbHelperSQL.ExecuteSQL(TempSqlStr);
            }
            else
            {
                //从产品库存中减去
                string TempSqlStr = "update ERPProduct set RuKuSum=RuKuSum+" + this.txtShuLiang.Text + ",NowKuCun=NowKuCun+" + this.txtShuLiang.Text + " where ProductName='" + this.txtProductName.Text.ToString() + "'";
                ZWL.DBUtility.DbHelperSQL.ExecuteSQL(TempSqlStr);
            }
        }

        Model.Update();

        //写系统日志
        ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi();
        MyRiZhi.UserName    = ZWL.Common.PublicMethod.GetSessionValue("UserName");
        MyRiZhi.DoSomething = "用户修改采购订单产品信息(" + this.txtOrderName.Text + ")";
        MyRiZhi.IpStr       = System.Web.HttpContext.Current.Request.UserHostAddress.ToString();
        MyRiZhi.Add();

        ZWL.Common.MessageBox.ShowAndRedirect(this, "采购订单产品信息修改成功!", "BuyLog.aspx?OrderName=" + Request.QueryString["OrderName"].ToString());
    }
Пример #3
0
    public void DataBindToGridview()
    {
        ZWL.BLL.ERPBuyChanPin MyModel = new ZWL.BLL.ERPBuyChanPin();
        string XiaShuUser             = ZWL.DBUtility.DbHelperSQL.GetSHSLInt("select top 1 XiaShuUser from ERPUser where UserName='******'");
        string SSTempSTR = "";

        if (XiaShuUser != "全部")
        {
            SSTempSTR = "and UserName in(" + "'" + XiaShuUser.Replace(",", "','") + "'" + ")";
        }
        string sql = "";

        if (!string.IsNullOrEmpty(this.TextBox1.Text))
        {
            sql += "(OrderName Like '%" + this.TextBox1.Text + "%' or ProductName Like '%" + this.TextBox1.Text + "%' or ProductSerils Like '%" + this.TextBox1.Text + "%' or GongYingShang Like '%" + this.TextBox1.Text + "%' or UserName Like '%" + this.TextBox1.Text + "%' or ProductType Like '%" + this.TextBox1.Text + "%' or IFJiaoFu Like '%" + this.TextBox1.Text + "%')";
        }
        if (!string.IsNullOrEmpty(this.TextBox3.Text))
        {
            if (string.IsNullOrEmpty(sql))
            {
                sql += " TimeStr >='" + this.TextBox3.Text.Trim() + " 00:00:00' and TimeStr<='" + this.TextBox4.Text.Trim() + " 23:59:59' ";
            }
            else
            {
                sql += "and TimeStr >='" + this.TextBox3.Text.Trim() + " 00:00:00' and TimeStr<='" + this.TextBox4.Text.Trim() + " 23:59:59' ";
            }
            sql += " " + SSTempSTR + "  order by ID desc";
        }
        GVData.DataSource = MyModel.GetList(sql);
        GVData.DataBind();
        LabPageSum.Text     = Convert.ToString(GVData.PageCount);
        LabCurrentPage.Text = Convert.ToString(((int)GVData.PageIndex + 1));
        this.GoPage.Text    = LabCurrentPage.Text.ToString();
    }
Пример #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ZWL.Common.PublicMethod.CheckSession();
            this.txtOrderName.Attributes.Add("readonly", "true");
            this.txtProductName.Attributes.Add("readonly", "true");
            ZWL.BLL.ERPBuyChanPin Model = new ZWL.BLL.ERPBuyChanPin();
            Model.GetModel(int.Parse(Request.QueryString["ID"].ToString()));
            this.txtOrderName.Text              = Model.OrderName.ToString();
            this.txtProductName.Text            = Model.ProductName.ToString();
            this.txtProductSerils.Text          = Model.ProductSerils.ToString();
            this.txtGongYingShang.Text          = Model.GongYingShang.ToString();
            this.txtProductType.Text            = Model.ProductType.ToString();
            this.txtXingHao.Text                = Model.XingHao.ToString();
            this.txtDanWei.Text                 = Model.DanWei.ToString();
            this.txtDanJia.Text                 = Model.DanJia.ToString();
            this.txtShuLiang.Text               = Model.ShuLiang.ToString();
            this.txtZongJia.Text                = Model.ZongJia.ToString();
            this.txtYiFuKuan.Text               = Model.YiFuKuan.ToString();
            this.txtQianKuanShu.Text            = Model.QianKuanShu.ToString();
            this.RadioButtonList1.SelectedValue = Model.IFJiaoFu.ToString();
            this.txtChanPinMiaoShu.Text         = Model.ChanPinMiaoShu.ToString();
            this.txtUserName.Text               = Model.UserName.ToString();
            this.txtTimeStr.Text                = Model.TimeStr.ToString();
            this.txtBackInfo.Text               = Model.BackInfo.ToString();
            this.Label1.Text = Model.ShuLiang.ToString();
            this.Label4.Text = Model.IFJiaoFu.ToString();

            RefreshData();
        }
    }
Пример #5
0
 public void DataBindToGridview()
 {
     ZWL.BLL.ERPBuyChanPin MyModel = new ZWL.BLL.ERPBuyChanPin();
     GVData.DataSource = MyModel.GetList("OrderName Like '%" + this.TextBox1.Text + "%' order by ID desc");
     GVData.DataBind();
     LabPageSum.Text     = Convert.ToString(GVData.PageCount);
     LabCurrentPage.Text = Convert.ToString(((int)GVData.PageIndex + 1));
     this.GoPage.Text    = LabCurrentPage.Text.ToString();
 }