Esempio n. 1
0
    /// <summary>
    /// 绑定Grid
    /// </summary>
    protected void BindGrid()
    {
        BCheckDetailBB checkDetailBB = new BCheckDetailBB();
        DataSet ds = new DataSet();

        try
        {
            ds = checkDetailBB.GetVList(this.StrWhere);
            this.grid1.DataSource = ds.Tables[0];
            this.grid1.DataBind();
            //赋值记录条数、页面总数
        }
        finally
        {
            checkDetailBB.Dispose();
        }
    }
Esempio n. 2
0
    /// <summary>
    /// 保存工作,返回明细表基本信息
    /// </summary>
    /// <returns></returns>
    private List<BCheckDetailData> SetDetailApplyBillModel()
    {
        BCheckDetailBB checkDetailBB = new BCheckDetailBB();

        try
        {
            List<BCheckDetailData> list = new List<BCheckDetailData>();

            foreach (DataRow dr in this.DtResult.Rows)
            {
                BCheckDetailData model = new BCheckDetailData();
                int detailId = Convert.ToInt32(dr["BCheckDetailID"]);//表BCheckDetail的ID

                //修改行
                if (detailId > 0)
                {
                    model = checkDetailBB.GetModel(detailId);
                }

                //删除已有数据
                if (detailId > 0 && dr["isdel"].ToString() == "1")
                {
                    model.checkBillId = -1;
                }

                //赋值,将新增的和修改的明细项,增加到list
                if ((detailId == 0 && dr["isdel"].ToString() == "0") || detailId > 0)
                {
                    model.id = detailId;//检测单明细ID

                    if (HS.Function.CommFunction.IsInt(dr["checkDetailId"].ToString()))
                    {
                        model.checkDetailId = Convert.ToInt32(dr["checkDetailId"]);//检测标准ID
                    }

                    //开箱数量
                    if (dr["openBoxNum"] != DBNull.Value)
                    {
                        model.openBoxNum = Convert.ToDouble(dr["openBoxNum"]);
                    }
                    else
                    {
                        model.openBoxNum = 0;
                    }

                    //检测数量
                    if (dr["checkNum"] != DBNull.Value)
                    {
                        model.checkNum = Convert.ToDouble(dr["checkNum"]);
                    }
                    else
                    {
                        model.checkNum = 0;
                    }

                    list.Add(model);
                }
            }

            return list;
        }
        finally
        {
            checkDetailBB.Dispose();
        }
    }
Esempio n. 3
0
    public DataTable GetCheckDetail(string strCheckBillId)
    {
        BCheckDetailBB checkDetailBB = new BCheckDetailBB();

        try
        {
            DataTable dt = new DataTable();

            dt = checkDetailBB.GetVList("checkBillId=" + strCheckBillId).Tables[0];
            return dt;
        }
        finally
        {
            checkDetailBB.Dispose();
        }
    }