Esempio n. 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <TSM.Model.pms_Quotation_Details> DataTableToList(DataTable dt)
        {
            List <TSM.Model.pms_Quotation_Details> modelList = new List <TSM.Model.pms_Quotation_Details>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                TSM.Model.pms_Quotation_Details model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new TSM.Model.pms_Quotation_Details();
                    if (dt.Rows[n]["QuotationDetailsID"].ToString() != "")
                    {
                        model.QuotationDetailsID = int.Parse(dt.Rows[n]["QuotationDetailsID"].ToString());
                    }
                    if (dt.Rows[n]["QuotationInfoID"].ToString() != "")
                    {
                        model.QuotationInfoID = int.Parse(dt.Rows[n]["QuotationInfoID"].ToString());
                    }
                    if (dt.Rows[n]["MachinePriceID"].ToString() != "")
                    {
                        model.MachinePriceID = int.Parse(dt.Rows[n]["MachinePriceID"].ToString());
                    }
                    if (dt.Rows[n]["WorkingHour"].ToString() != "")
                    {
                        model.WorkingHour = int.Parse(dt.Rows[n]["WorkingHour"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Esempio n. 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(TSM.Model.pms_Quotation_Details model)
 {
     dal.Update(model);
 }
Esempio n. 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(TSM.Model.pms_Quotation_Details model)
 {
     return(dal.Add(model));
 }