Beispiel #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <DTcms.Model.CheckRecord> DataTableToList(DataTable dt)
        {
            List <DTcms.Model.CheckRecord> modelList = new List <DTcms.Model.CheckRecord>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                DTcms.Model.CheckRecord model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new DTcms.Model.CheckRecord();
                    if (dt.Rows[n]["Id"].ToString() != "")
                    {
                        model.Id = int.Parse(dt.Rows[n]["Id"].ToString());
                    }
                    if (dt.Rows[n]["VehicleId"].ToString() != "")
                    {
                        model.VehicleId = int.Parse(dt.Rows[n]["VehicleId"].ToString());
                    }
                    if (dt.Rows[n]["CustomerId"].ToString() != "")
                    {
                        model.CustomerId = int.Parse(dt.Rows[n]["CustomerId"].ToString());
                    }
                    if (dt.Rows[n]["HandlingModeId"].ToString() != "")
                    {
                        model.HandlingModeId = int.Parse(dt.Rows[n]["HandlingModeId"].ToString());
                    }
                    if (dt.Rows[n]["GoodsId"].ToString() != "")
                    {
                        model.GoodsId = int.Parse(dt.Rows[n]["GoodsId"].ToString());
                    }
                    if (dt.Rows[n]["Status"].ToString() != "")
                    {
                        model.Status = int.Parse(dt.Rows[n]["Status"].ToString());
                    }
                    if (dt.Rows[n]["CreateTime"].ToString() != "")
                    {
                        model.CreateTime = DateTime.Parse(dt.Rows[n]["CreateTime"].ToString());
                    }
                    model.Admin            = dt.Rows[n]["Admin"].ToString();
                    model.InspectionNumber = dt.Rows[n]["InspectionNumber"].ToString();
                    model.CaseNumber       = dt.Rows[n]["CaseNumber"].ToString();
                    model.CheckResult      = dt.Rows[n]["CheckResult"].ToString();
                    model.RealName         = dt.Rows[n]["RealName"].ToString();
                    model.LinkTel          = dt.Rows[n]["LinkMan"].ToString();
                    model.Remark           = dt.Rows[n]["Remark"].ToString();


                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Beispiel #2
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<DTcms.Model.CheckRecord> DataTableToList(DataTable dt)
        {
            List<DTcms.Model.CheckRecord> modelList = new List<DTcms.Model.CheckRecord>();
            int rowsCount = dt.Rows.Count;
            if (rowsCount > 0)
            {
                DTcms.Model.CheckRecord model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new DTcms.Model.CheckRecord();
                    if (dt.Rows[n]["Id"].ToString() != "")
                    {
                        model.Id = int.Parse(dt.Rows[n]["Id"].ToString());
                    }
                    if (dt.Rows[n]["VehicleId"].ToString() != "")
                    {
                        model.VehicleId = int.Parse(dt.Rows[n]["VehicleId"].ToString());
                    }
                    if (dt.Rows[n]["CustomerId"].ToString() != "")
                    {
                        model.CustomerId = int.Parse(dt.Rows[n]["CustomerId"].ToString());
                    }
                    if (dt.Rows[n]["HandlingModeId"].ToString() != "")
                    {
                        model.HandlingModeId = int.Parse(dt.Rows[n]["HandlingModeId"].ToString());
                    }
                    if (dt.Rows[n]["GoodsId"].ToString() != "")
                    {
                        model.GoodsId = int.Parse(dt.Rows[n]["GoodsId"].ToString());
                    }
                    if (dt.Rows[n]["Status"].ToString() != "")
                    {
                        model.Status = int.Parse(dt.Rows[n]["Status"].ToString());
                    }
                    if (dt.Rows[n]["CreateTime"].ToString() != "")
                    {
                        model.CreateTime = DateTime.Parse(dt.Rows[n]["CreateTime"].ToString());
                    }
                    model.Admin = dt.Rows[n]["Admin"].ToString();
                    model.InspectionNumber = dt.Rows[n]["InspectionNumber"].ToString();
                    model.CaseNumber = dt.Rows[n]["CaseNumber"].ToString();
                    model.CheckResult = dt.Rows[n]["CheckResult"].ToString();
                    model.RealName = dt.Rows[n]["RealName"].ToString();
                    model.LinkTel = dt.Rows[n]["LinkMan"].ToString();
                    model.Remark = dt.Rows[n]["Remark"].ToString();

                    modelList.Add(model);
                }
            }
            return modelList;
        }
Beispiel #3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(DTcms.Model.CheckRecord model)
 {
     return(dal.Update(model));
 }
Beispiel #4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(DTcms.Model.CheckRecord model)
 {
     return(dal.Add(model));
 }
Beispiel #5
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void  Add(DTcms.Model.CheckRecord model)
 {
     dal.Add(model);
 }