Beispiel #1
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(HM.Model.Eq.Tb_EQ_WbTask model)
 {
     dal.Add(model);
 }
Beispiel #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(HM.Model.Eq.Tb_EQ_WbTask model)
 {
     dal.Update(model);
 }
Beispiel #3
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <HM.Model.Eq.Tb_EQ_WbTask> DataTableToList(DataTable dt)
        {
            List <HM.Model.Eq.Tb_EQ_WbTask> modelList = new List <HM.Model.Eq.Tb_EQ_WbTask>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                HM.Model.Eq.Tb_EQ_WbTask model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model        = new HM.Model.Eq.Tb_EQ_WbTask();
                    model.TaskId = dt.Rows[n]["TaskId"].ToString();
                    if (dt.Rows[n]["CommId"].ToString() != "")
                    {
                        model.CommId = int.Parse(dt.Rows[n]["CommId"].ToString());
                    }
                    model.PlanId  = dt.Rows[n]["PlanId"].ToString();
                    model.TaskNO  = dt.Rows[n]["TaskNO"].ToString();
                    model.EqId    = dt.Rows[n]["EqId"].ToString();
                    model.SpaceId = dt.Rows[n]["SpaceId"].ToString();
                    model.Content = dt.Rows[n]["Content"].ToString();
                    if (dt.Rows[n]["BeginTime"].ToString() != "")
                    {
                        model.BeginTime = DateTime.Parse(dt.Rows[n]["BeginTime"].ToString());
                    }
                    if (dt.Rows[n]["EndTime"].ToString() != "")
                    {
                        model.EndTime = DateTime.Parse(dt.Rows[n]["EndTime"].ToString());
                    }
                    model.WorkDayBegin = dt.Rows[n]["WorkDayBegin"].ToString();
                    model.RoleCode     = dt.Rows[n]["RoleCode"].ToString();
                    model.Statue       = dt.Rows[n]["Statue"].ToString();
                    model.ClosePerson  = dt.Rows[n]["ClosePerson"].ToString();
                    if (dt.Rows[n]["CloseTime"].ToString() != "")
                    {
                        model.CloseTime = DateTime.Parse(dt.Rows[n]["CloseTime"].ToString());
                    }
                    model.CloseReason   = dt.Rows[n]["CloseReason"].ToString();
                    model.PollingPerson = dt.Rows[n]["PollingPerson"].ToString();
                    if (dt.Rows[n]["PollingDate"].ToString() != "")
                    {
                        model.PollingDate = DateTime.Parse(dt.Rows[n]["PollingDate"].ToString());
                    }
                    model.Remark = dt.Rows[n]["Remark"].ToString();
                    if (dt.Rows[n]["IsDelete"].ToString() != "")
                    {
                        model.IsDelete = int.Parse(dt.Rows[n]["IsDelete"].ToString());
                    }
                    model.AddPId = dt.Rows[n]["AddPId"].ToString();
                    if (dt.Rows[n]["AddDate"].ToString() != "")
                    {
                        model.AddDate = DateTime.Parse(dt.Rows[n]["AddDate"].ToString());
                    }
                    model.PerfNum  = dt.Rows[n]["PerfNum"].ToString();
                    model.WorkTime = dt.Rows[n]["WorkTime"].ToString();
                    if (dt.Rows[n]["IsEntrust"].ToString() != "")
                    {
                        model.IsEntrust = int.Parse(dt.Rows[n]["IsEntrust"].ToString());
                    }
                    model.EntrustCompany = dt.Rows[n]["EntrustCompany"].ToString();
                    model.CheckRoleCode  = dt.Rows[n]["CheckRoleCode"].ToString();
                    model.PersonInCharge = dt.Rows[n]["PersonInCharge"].ToString();
                    if (dt.Rows[n]["DoTime"].ToString() != "")
                    {
                        model.DoTime = DateTime.Parse(dt.Rows[n]["DoTime"].ToString());
                    }
                    model.CheckMan    = dt.Rows[n]["CheckMan"].ToString();
                    model.CheckNoto   = dt.Rows[n]["CheckNoto"].ToString();
                    model.CheckRusult = dt.Rows[n]["CheckRusult"].ToString();
                    if (dt.Rows[n]["CheckTime"].ToString() != "")
                    {
                        model.CheckTime = DateTime.Parse(dt.Rows[n]["CheckTime"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }