/// <summary>
 /// 展示数据
 /// </summary>
 /// <param name="id">记录Id</param>
 private void ShowInfo(int id)
 {
     LCheckDetailBB checkDetailBB = new LCheckDetailBB();
     vLCheckDetailData model = new vLCheckDetailData();
     try
     {
         model = checkDetailBB.GetVModel(id);
         this.id.Text = model.id.ToString();
         this.checkDetailDesc.Text = model.checkDetailDesc;
         this.materialNo.Text = model.materialNo;
         this.checkFileId.Text = model.checkFileId.ToString();
         this.checkItemId.Text = model.checkItemId.ToString();
         this.dateType.Text = model.dateType;
         this.unit.Text = model.unit;
         this.uplimit.Text = model.uplimit;
         this.downlimit.Text = model.downlimit;
         this.standDesc.Text = model.standDesc;
         this.isMustCheck.Text = model.isMustCheck.ToString();
         this.isAddupCheck.Text = model.isAddupCheck.ToString();
         this.checkAmount.Text = model.checkAmount.ToString();
         this.arrivedAmount.Text = model.arrivedAmount.ToString();
         this.openBoxScale.Text = model.openBoxScale.ToString();
         this.checkOutScale.Text = model.checkOutScale.ToString();
         this.mark.Text = model.mark;
     }
     finally
     {
         checkDetailBB.Dispose();
     }
 }
Пример #2
0
        /// <summary>
        /// 得到一个视图model
        /// </summary>
        /// <param name="id">主键值</param>
        /// <returns>model</returns>
        public vLCheckDetailData GetVModel(int id)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append(@"select id,checkDetailDesc,materialNo,checkFileId,checkItemId,dateType,unit,uplimit,downlimit,standDesc,isMustCheck,
                            isAddupCheck,checkAmount,arrivedAmount,openBoxScale,checkOutScale,mark,isrtEmpId,isrtDt,updtEmpId,updtDt,
                            materialDesc,checkItemNo,checkItemNm,updtEmpNo,updtEmpNm,preFileNm,downFileNm,isMustCheckDesc,isAddupCheckDesc,openBoxScaleDesc,
                            checkOutScaleDesc,fileUrl from vLCheckDetail");
            strSql.Append(" where id = @id ");
            SqlParameter[] parameters = {
                    new SqlParameter("@id", SqlDbType.Int)
                };
            parameters[0].Value = id;

            vLCheckDetailData model = new vLCheckDetailData();
            DataSet ds = SqlHelper.ExecuteDataset(this.connection, this.transaction, CommandType.Text, strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                DataRow row = ds.Tables[0].Rows[0];
                if (row["id"] != DBNull.Value)
                {
                    model.id = Convert.ToInt32(row["id"]);
                }
                if (row["checkDetailDesc"] != DBNull.Value)
                {
                    model.checkDetailDesc = Convert.ToString(row["checkDetailDesc"]);
                }
                if (row["materialNo"] != DBNull.Value)
                {
                    model.materialNo = Convert.ToString(row["materialNo"]);
                }
                if (row["checkFileId"] != DBNull.Value)
                {
                    model.checkFileId = Convert.ToInt32(row["checkFileId"]);
                }
                if (row["checkItemId"] != DBNull.Value)
                {
                    model.checkItemId = Convert.ToInt32(row["checkItemId"]);
                }
                if (row["dateType"] != DBNull.Value)
                {
                    model.dateType = Convert.ToString(row["dateType"]);
                }
                if (row["unit"] != DBNull.Value)
                {
                    model.unit = Convert.ToString(row["unit"]);
                }
                if (row["uplimit"] != DBNull.Value)
                {
                    model.uplimit = Convert.ToString(row["uplimit"]);
                }
                if (row["downlimit"] != DBNull.Value)
                {
                    model.downlimit = Convert.ToString(row["downlimit"]);
                }
                if (row["standDesc"] != DBNull.Value)
                {
                    model.standDesc = Convert.ToString(row["standDesc"]);
                }
                if (row["isMustCheck"] != DBNull.Value)
                {
                    model.isMustCheck = Convert.ToBoolean(row["isMustCheck"]);
                }
                if (row["isAddupCheck"] != DBNull.Value)
                {
                    model.isAddupCheck = Convert.ToBoolean(row["isAddupCheck"]);
                }
                if (row["checkAmount"] != DBNull.Value)
                {
                    model.checkAmount = Convert.ToDouble(row["checkAmount"]);
                }
                if (row["arrivedAmount"] != DBNull.Value)
                {
                    model.arrivedAmount = Convert.ToDouble(row["arrivedAmount"]);
                }
                if (row["openBoxScale"] != DBNull.Value)
                {
                    model.openBoxScale = Convert.ToDouble(row["openBoxScale"]);
                }
                if (row["checkOutScale"] != DBNull.Value)
                {
                    model.checkOutScale = Convert.ToDouble(row["checkOutScale"]);
                }
                if (row["mark"] != DBNull.Value)
                {
                    model.mark = Convert.ToString(row["mark"]);
                }
                if (row["isrtEmpId"] != DBNull.Value)
                {
                    model.isrtEmpId = Convert.ToInt32(row["isrtEmpId"]);
                }
                if (row["isrtDt"] != DBNull.Value)
                {
                    model.isrtDt = Convert.ToString(row["isrtDt"]);
                }
                if (row["updtEmpId"] != DBNull.Value)
                {
                    model.updtEmpId = Convert.ToInt32(row["updtEmpId"]);
                }
                if (row["updtDt"] != DBNull.Value)
                {
                    model.updtDt = Convert.ToString(row["updtDt"]);
                }
                if (row["materialDesc"] != DBNull.Value)
                {
                    model.materialDesc = Convert.ToString(row["materialDesc"]);
                }
                if (row["checkItemNo"] != DBNull.Value)
                {
                    model.checkItemNo = Convert.ToString(row["checkItemNo"]);
                }
                if (row["checkItemNm"] != DBNull.Value)
                {
                    model.checkItemNm = Convert.ToString(row["checkItemNm"]);
                }
                if (row["updtEmpNo"] != DBNull.Value)
                {
                    model.updtEmpNo = Convert.ToString(row["updtEmpNo"]);
                }
                if (row["updtEmpNm"] != DBNull.Value)
                {
                    model.updtEmpNm = Convert.ToString(row["updtEmpNm"]);
                }
                if (row["preFileNm"] != DBNull.Value)
                {
                    model.preFileNm = Convert.ToString(row["preFileNm"]);
                }
                if (row["downFileNm"] != DBNull.Value)
                {
                    model.downFileNm = Convert.ToString(row["downFileNm"]);
                }
                if (row["isMustCheckDesc"] != DBNull.Value)
                {
                    model.isMustCheckDesc = Convert.ToString(row["isMustCheckDesc"]);
                }
                if (row["isAddupCheckDesc"] != DBNull.Value)
                {
                    model.isAddupCheckDesc = Convert.ToString(row["isAddupCheckDesc"]);
                }
                if (row["openBoxScaleDesc"] != DBNull.Value)
                {
                    model.openBoxScaleDesc = Convert.ToDouble(row["openBoxScaleDesc"]);
                }
                if (row["checkOutScaleDesc"] != DBNull.Value)
                {
                    model.checkOutScaleDesc = Convert.ToDouble(row["checkOutScaleDesc"]);
                }
                if (row["fileUrl"] != DBNull.Value)
                {
                    model.fileUrl = Convert.ToString(row["fileUrl"]);
                }
                return model;
            }
            else
            {
                return null;
            }
        }
Пример #3
0
 /// <summary>
 /// 展示数据
 /// </summary>
 /// <param name="id">记录Id</param>
 private void ShowInfo(int id)
 {
     LCheckDetailBB checkDetailBB = new LCheckDetailBB();
     vLCheckDetailData model = new vLCheckDetailData();
     SFileBB fileBB = new SFileBB();
     try
     {
         model = checkDetailBB.GetVModel(id);
         this.materialNo.Text = model.materialNo;
         this.materialDesc.Text = model.materialDesc;
         this.checkDetailDesc.Text = model.checkDetailDesc;
         this.checkItemId.SelectedValue = model.checkItemId.ToString();
         this.dateType.SelectedValue = model.dateType;
         this.unit.Text = model.unit;
         this.uplimit.Text = model.uplimit;
         this.downlimit.Text = model.downlimit;
         this.standDesc.Text = model.standDesc;
         if (model.isMustCheck != null)
         {
             this.isMustCheck.Checked = model.isMustCheck;
         }
         if (model.isAddupCheck != null)
         {
             this.isAddupCheck.Checked = model.isAddupCheck;
         }
         this.checkAmount.Text = model.checkAmount.ToString();
         this.openBoxScale.Text = Convert.ToString(model.openBoxScale * 100);
         this.checkOutScale.Text = Convert.ToString(model.checkOutScale * 100);
         this.mark.Text = model.mark;
         if (model.checkFileId != 0)
         {
             this.fileId.Value = Convert.ToString(model.checkFileId);
             this.fileNm.Value = fileBB.GetBatchFileNm(Convert.ToString(model.checkFileId));
             this.localeImage.ImageUrl = "../../../Common/Image.ashx?ImID=" + Convert.ToString(model.checkFileId);
         }
         //else
         //{
         //    this.fileId.Value = model.checkFileId.ToString();
         //    this.fileNm =
         //}
     }
     finally
     {
         checkDetailBB.Dispose();
         fileBB.Dispose();
     }
 }