Exemplo n.º 1
0
    public void DataBindToGridview()
    {
        string XiaShuUser = ZWL.DBUtility.DbHelperSQL.GetSHSLInt("select top 1 XiaShuUser from ERPUser where UserName='******'");
        string SSTempSTR  = "";

        if (XiaShuUser != "全部")
        {
            SSTempSTR = "and CreateUser in(" + "'" + XiaShuUser.Replace(",", "','") + "'" + ")";
        }
        ZWL.BLL.ERPContract MyModel = new ZWL.BLL.ERPContract();
        MyModel.HZ();
        string sql = "";

        if (!string.IsNullOrEmpty(this.TextBox1.Text))
        {
            sql += "(HeTongName Like '%" + this.TextBox1.Text + "%' or HeTongSerils Like '%" + this.TextBox1.Text + "%' or QianYueKeHu Like '%" + this.TextBox1.Text + "%' or HeTongLeiXing Like '%" + this.TextBox1.Text + "%' or CreateUser Like '%" + this.TextBox1.Text + "%' or SFJF Like '%" + this.TextBox1.Text + "%')";
        }
        if (!string.IsNullOrEmpty(this.TextBox3.Text))
        {
            if (string.IsNullOrEmpty(sql))
            {
                sql += " (CreateTime >='" + this.TextBox3.Text.Trim() + " 00:00:00' and CreateTime<='" + this.TextBox4.Text.Trim() + " 23:59:59')  or QianYueRenBuy = '" + this.TextBox3.Text + "' or QianYueRenBuy = '" + this.TextBox4.Text + "' or QianYueRenSell = '" + this.TextBox3.Text + "' or QianYueRenSell = '" + this.TextBox4.Text + "'";
            }
            else
            {
                sql += " and CreateTime >='" + this.TextBox3.Text.Trim() + " 00:00:00' and CreateTime<='" + this.TextBox4.Text.Trim() + " 23:59:59')  or QianYueRenBuy = '" + this.TextBox3.Text + "' or QianYueRenBuy = '" + this.TextBox4.Text + "' or QianYueRenSell = '" + this.TextBox3.Text + "' or QianYueRenSell = '" + this.TextBox4.Text + "' ";
            }
            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();
    }
Exemplo n.º 2
0
    public void DataBindToGridview()
    {
        ZWL.BLL.ERPContract MyModel = new ZWL.BLL.ERPContract();
        MyModel.HZ();
        string sql = " CreateUser='******'";

        if (!string.IsNullOrEmpty(this.TextBox1.Text))
        {
            sql += "  and  (HeTongName Like '%" + this.TextBox1.Text + "%' or HeTongSerils Like '%" + this.TextBox1.Text + "%' or QianYueKeHu Like '%" + this.TextBox1.Text + "%' or HeTongLeiXing Like '%" + this.TextBox1.Text + "%'  or SFJF Like '%" + this.TextBox1.Text + "%')";
        }
        if (!string.IsNullOrEmpty(this.TextBox3.Text))
        {
            if (string.IsNullOrEmpty(sql))
            {
                sql += " (CreateTime >='" + this.TextBox3.Text.Trim() + " 00:00:00' and CreateTime<='" + this.TextBox4.Text.Trim() + " 23:59:59')  or QianYueRenBuy = '" + this.TextBox3.Text + "' or QianYueRenBuy = '" + this.TextBox4.Text + "' or QianYueRenSell = '" + this.TextBox3.Text + "' or QianYueRenSell = '" + this.TextBox4.Text + "'";
            }
            else
            {
                sql += "and (CreateTime >='" + this.TextBox3.Text.Trim() + " 00:00:00' and CreateTime<='" + this.TextBox4.Text.Trim() + " 23:59:59')  or QianYueRenBuy = '" + this.TextBox3.Text + "' or QianYueRenBuy = '" + this.TextBox4.Text + "' or QianYueRenSell = '" + this.TextBox3.Text + "' or QianYueRenSell = '" + this.TextBox4.Text + "'";
            }
            sql += " 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();
    }
Exemplo n.º 3
0
 public void DataBindToGridview()
 {
     ZWL.BLL.ERPContract MyModel = new ZWL.BLL.ERPContract();
     GVData.DataSource = MyModel.GetList("HeTongName Like '%" + this.TextBox1.Text + "%' and CreateUser='******' 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();
 }
Exemplo n.º 4
0
 public void DataBindToGridview()
 {
     ZWL.BLL.ERPContract MyModel = new ZWL.BLL.ERPContract();
     GVData.DataSource = MyModel.GetList("HeTongName 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();
 }
Exemplo n.º 5
0
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        ZWL.BLL.ERPBuyOrder Model  = new ZWL.BLL.ERPBuyOrder();
        ZWL.BLL.ERPContract Model1 = new ZWL.BLL.ERPContract();
        if (ZWL.Common.PublicMethod.IFExists("OrderName", "ERPBuyOrder", 0, this.txtOrderName.Text) == true)
        {
            Model.OrderName         = this.txtOrderName.Text.ToString();
            Model.GongYingShangName = this.txtGongYingShangName.Text.ToString();
            Model.Serils            = this.txtSerils.Text.ToString();
            Model.DingDanLeiXing    = this.txtDingDanLeiXing.Text.ToString();
            Model.DingDanMiaoShu    = this.txtDingDanMiaoShu.Text.ToString();
            Model.CreateDate        = DateTime.Parse(this.txtCreateDate.Text);
            Model.LaiHuoDate        = DateTime.Parse(this.txtLaiHuoDate.Text);
            Model.TiXingDate        = DateTime.Parse(this.txtTiXingDate.Text);
            Model.ChuangJianRen     = this.txtChuangJianRen.Text.ToString();
            Model.FuZeRen           = this.txtFuZeRen.Text.ToString();
            Model.FuJianList        = ZWL.Common.PublicMethod.GetSessionValue("WenJianList");
            Model.NowState          = "等待审核";
            Model.ShenPiTongGuoRen  = "";
            Model.BackInfo          = this.txtBackInfo.Text.ToString();
            Model.UserName          = ZWL.Common.PublicMethod.GetSessionValue("UserName");
            Model.TimeStr           = DateTime.Now;

            Model.Add();
            DataSet ds = Model1.GetList("HeTongName='" + this.txtOrderName.Text + "'");
            if (ds.Tables[0].Rows.Count > 0)
            {
                string sql = "update  ERPContract set NowState='正在采购' where ID=" + ds.Tables[0].Rows[0]["ID"].ToString() + "";
                DbHelperSQL.ExecuteSql(sql.ToString());
            }

            //写系统日志
            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, "采购订单信息添加成功!", "BuyDengJi.aspx");
        }
        else
        {
            ZWL.Common.MessageBox.Show(this, "该订单名称已经存在,请更改其他订单名称!");
        }
    }