Пример #1
0
    /// <summary>
    /// 绑定事件
    /// </summary>
    public void Bind()
    {
        int    Counts = 0;
        string type   = Request["type"];

        strwhere += " and Type='" + type + "' and dr=0 and CompID='" + this.CompID + "'";
        DataTable dt = new Hi.BLL.DIS_StockOrder().GetListPage(PageSize, Convert.ToInt32(PageIndex), strwhere);

        this.Repeater1.DataSource = dt;
        this.Repeater1.DataBind();
        Counts            = new Hi.BLL.DIS_StockOrder().GetPageCount(strwhere);
        Pager.RecordCount = Counts;
        PageIndex         = Pager.CurrentPageIndex.ToString();
    }
Пример #2
0
    /// <summary>
    /// 修改绑定
    /// </summary>
    /// <param name="type">入库or出库</param>
    /// <param name="no">单据ID</param>
    public void Bind(int type, string no)
    {
        no = Common.NoHTML(no);
        List <Hi.Model.DIS_StockOrder> order = new Hi.BLL.DIS_StockOrder().GetList("State,OrderNO,StockType,Remark,ChkDate", " ID='" + no + "'", "ID");

        if (order.Count > 0)
        {
            if (order[0].State == 2)
            {
                this.orderaudit.Visible = false;
                this.edit.Visible       = false;
                this.del.Visible        = false;
            }
            else
            {
                this.edit.Visible       = true;
                this.orderaudit.Visible = true;
                this.del.Visible        = true;
            }
            this.lblNo.InnerText   = order[0].OrderNO;
            this.lblType.InnerText = order[0].StockType;
            this.lbldate.InnerText = order[0].ChkDate.ToString("yyyy-MM-dd");
            if (order[0].Remark != null && order[0].Remark.Length > 70)
            {
                string rmk = order[0].Remark.Substring(0, 70).Trim();
                this.lblRmk.InnerText = rmk + "......";
            }
            else
            {
                this.lblRmk.InnerText = order[0].Remark;
            }
            this.txtbox.InnerText = order[0].Remark;

            string    sql = string.Format(@"select BD_GoodsInfo.ValueInfo,BD_Goods.Unit,DIS_StockInOut.ID,DIS_StockInOut.StockNum,DIS_StockInOut.BatchNO,DIS_StockInOut.validDate,DIS_StockInOut.Remark,DIS_StockInOut.GoodsID,
         BD_Goods.GoodsName, BD_Goods.Pic, BD_GoodsInfo.BarCode, BD_GoodsInfo.ID as GoodsinfoID from DIS_StockInOut  join BD_GoodsInfo on
         DIS_StockInOut.GoodsInfoID = BD_GoodsInfo.ID 
        join BD_Goods on BD_GoodsInfo.GoodsID = BD_Goods.ID and DIS_StockInOut.StockOrderID={0}", no);
            DataTable dt  = new Hi.BLL.DIS_StockOrder().GetDataTable(sql);
            if (dt.Rows.Count > 0)
            {
                this.tbodyTR.Visible      = false;
                this.Repeater1.DataSource = dt;
                this.Repeater1.DataBind();
            }
        }
    }
Пример #3
0
    public void databind()
    {
        if (!string.IsNullOrEmpty(Request["KeyID"]))
        {
            KeyID = Common.DesDecrypt((Request["KeyID"] + ""), Common.EncryptKey).ToInt(0);
        }

        string where = " ISNULL(dr,0)=0 and ID=" + KeyID;

        List <Hi.Model.DIS_StockOrder> solist = new Hi.BLL.DIS_StockOrder().GetList("", where, "");

        if (solist != null && solist.Count > 0)
        {
            // 订单编号
            lblReceiptNo.InnerText = solist[0].OrderNO;
            codeno = solist[0].OrderNO.ToString();
            this.Image1.ImageUrl    = "~/Distributor/newOrder/Code39.aspx?KeyID=" + codeno;
            lblCreateDate.InnerText = solist[0].CreateDate.ToString().ToDateTime().ToString("yyyy-MM-dd");
            this.lblType.InnerText  = solist[0].StockType;

            if (solist[0].Type == 2)//商品出库
            {
                TitleType  = "出库";
                this.Title = "商品出库单详细";
            }
            else if (solist[0].Type == 1)
            {
                TitleType  = "入库";
                this.Title = "商品入库单详细";
            }

            //商品明细
            string    goods = string.Format(@"select i.*,info.ValueInfo,g.GoodsCode,g.GoodsName,g.Unit,info.TinkerPrice from DIS_StockInOut i left join BD_GoodsInfo info on i.GoodsInfoID=info.ID left join BD_Goods g on info.GoodsID=g.ID where ISNULL(i.dr,0)=0 and i.StockOrderID={0}", KeyID);
            DataTable l     = new Hi.BLL.DIS_StockInOut().GetDataTable(goods);
            if (l != null && l.Rows.Count > 0)
            {
                rptOrderD.DataSource = l;
                rptOrderD.DataBind();
            }
        }
    }
Пример #4
0
    public void Bind(string no)
    {
        no = Common.NoHTML(no);
        List <Hi.Model.DIS_StockOrder> order = new Hi.BLL.DIS_StockOrder().GetList("OrderNO,ChkDate,Remark", " ID='" + no + "'", "ID");

        if (order.Count > 0)
        {
            this.txt_orderno.Value = order[0].OrderNO;
            this.txt_ChkDate.Value = order[0].ChkDate.ToShortDateString();
            this.txt_remark.Value  = order[0].Remark;
            string    sql = string.Format(@"select BD_GoodsInfo.ValueInfo,BD_Goods.Unit,DIS_StockChk.ID,DIS_StockChk.StockOldNum,DIS_StockChk.StockNum,DIS_StockChk.Remark,DIS_StockChk.GoodsID,
         BD_Goods.GoodsName, BD_Goods.Pic, BD_GoodsInfo.BarCode, BD_GoodsInfo.ID as GoodsinfoID from DIS_StockChk  join BD_GoodsInfo on
         DIS_StockChk.GoodsInfoID = BD_GoodsInfo.ID 
        join BD_Goods on DIS_StockChk.GoodsID = BD_Goods.ID and DIS_StockChk.StockOrderID={0}", no);
            DataTable dt  = new Hi.BLL.DIS_StockOrder().GetDataTable(sql);
            if (dt.Rows.Count > 0)
            {
                this.tbodyTR.Visible      = false;
                this.Repeater1.DataSource = dt;
                this.Repeater1.DataBind();
            }
        }
    }
Пример #5
0
    public void DataBinds()
    {
        int Counts = 0;
        ////每页显示的数据设置
        //if (this.txtPageSize.Value.ToString() != "")
        //{
        //    if (this.txtPageSize.Value.Trim().Length >= 5)
        //    {
        //        Pager.PageSize = 100;
        //        this.txtPageSize.Value = "100";
        //    }
        //    else
        //    {
        //        Pager.PageSize = this.txtPageSize.Value.Trim().ToInt(0);
        //    }
        //}
        DataTable LUser = new Hi.BLL.DIS_StockOrder().GetListPage(Pager.PageSize, Convert.ToInt32(page), SearchWhere());

        this.Rpt_Company.DataSource = LUser;
        this.Rpt_Company.DataBind();
        Counts            = new Hi.BLL.DIS_StockOrder().GetPageCount(SearchWhere());
        Pager.RecordCount = Counts;
        page = Pager.CurrentPageIndex.ToString();
    }
Пример #6
0
    /// <summary>
    /// 修改绑定
    /// </summary>
    /// <param name="type">入库or出库</param>
    /// <param name="no">单据ID</param>
    public void Bind(int type, string no)
    {
        no = Common.NoHTML(no);
        List <Hi.Model.DIS_StockOrder> order = new Hi.BLL.DIS_StockOrder().GetList("OrderNO,StockType,Remark", " ID='" + no + "'", "ID");

        if (order.Count > 0)
        {
            this.Notex.Value = order[0].OrderNO;
            this.DropDownList1.SelectedValue = order[0].StockType;
            this.Remarktex.Value             = order[0].Remark;

            string    sql = string.Format(@"select BD_GoodsInfo.ValueInfo,BD_Goods.Unit,DIS_StockInOut.ID,DIS_StockInOut.StockNum,DIS_StockInOut.Remark,DIS_StockInOut.GoodsID,DIS_StockInOut.BatchNO,DIS_StockInOut.validDate,
         BD_Goods.GoodsName, BD_Goods.Pic, BD_GoodsInfo.BarCode, BD_GoodsInfo.ID as GoodsinfoID from DIS_StockInOut  join BD_GoodsInfo on
         DIS_StockInOut.GoodsInfoID = BD_GoodsInfo.ID 
        join BD_Goods on BD_GoodsInfo.GoodsID = BD_Goods.ID and DIS_StockInOut.StockOrderID={0}", no);
            DataTable dt  = new Hi.BLL.DIS_StockOrder().GetDataTable(sql);
            if (dt.Rows.Count > 0)
            {
                this.tbodyTR.Visible      = false;
                this.Repeater1.DataSource = dt;
                this.Repeater1.DataBind();
            }
        }
    }