示例#1
0
 /// <summary>
 /// ��������б�
 /// </summary>
 public List<XHD.Model.CRM_Follow> DataTableToList(DataTable dt)
 {
     List<XHD.Model.CRM_Follow> modelList = new List<XHD.Model.CRM_Follow>();
     int rowsCount = dt.Rows.Count;
     if (rowsCount > 0)
     {
         XHD.Model.CRM_Follow model;
         for (int n = 0; n < rowsCount; n++)
         {
             model = new XHD.Model.CRM_Follow();
             if(dt.Rows[n]["id"]!=null && dt.Rows[n]["id"].ToString()!="")
             {
                 model.id=int.Parse(dt.Rows[n]["id"].ToString());
             }
             if(dt.Rows[n]["Customer_id"]!=null && dt.Rows[n]["Customer_id"].ToString()!="")
             {
                 model.Customer_id=int.Parse(dt.Rows[n]["Customer_id"].ToString());
             }
             if(dt.Rows[n]["Customer_name"]!=null && dt.Rows[n]["Customer_name"].ToString()!="")
             {
             model.Customer_name=dt.Rows[n]["Customer_name"].ToString();
             }
             if(dt.Rows[n]["Follow"]!=null && dt.Rows[n]["Follow"].ToString()!="")
             {
             model.Follow=dt.Rows[n]["Follow"].ToString();
             }
             if(dt.Rows[n]["Follow_date"]!=null && dt.Rows[n]["Follow_date"].ToString()!="")
             {
                 model.Follow_date=DateTime.Parse(dt.Rows[n]["Follow_date"].ToString());
             }
             if(dt.Rows[n]["Follow_Type_id"]!=null && dt.Rows[n]["Follow_Type_id"].ToString()!="")
             {
                 model.Follow_Type_id=int.Parse(dt.Rows[n]["Follow_Type_id"].ToString());
             }
             if(dt.Rows[n]["Follow_Type"]!=null && dt.Rows[n]["Follow_Type"].ToString()!="")
             {
             model.Follow_Type=dt.Rows[n]["Follow_Type"].ToString();
             }
             if(dt.Rows[n]["department_id"]!=null && dt.Rows[n]["department_id"].ToString()!="")
             {
                 model.department_id=int.Parse(dt.Rows[n]["department_id"].ToString());
             }
             if(dt.Rows[n]["department_name"]!=null && dt.Rows[n]["department_name"].ToString()!="")
             {
             model.department_name=dt.Rows[n]["department_name"].ToString();
             }
             if(dt.Rows[n]["employee_id"]!=null && dt.Rows[n]["employee_id"].ToString()!="")
             {
                 model.employee_id=int.Parse(dt.Rows[n]["employee_id"].ToString());
             }
             if(dt.Rows[n]["employee_name"]!=null && dt.Rows[n]["employee_name"].ToString()!="")
             {
             model.employee_name=dt.Rows[n]["employee_name"].ToString();
             }
             if(dt.Rows[n]["isDelete"]!=null && dt.Rows[n]["isDelete"].ToString()!="")
             {
                 model.isDelete=int.Parse(dt.Rows[n]["isDelete"].ToString());
             }
             if(dt.Rows[n]["Delete_time"]!=null && dt.Rows[n]["Delete_time"].ToString()!="")
             {
                 model.Delete_time=DateTime.Parse(dt.Rows[n]["Delete_time"].ToString());
             }
             modelList.Add(model);
         }
     }
     return modelList;
 }
示例#2
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(XHD.Model.CRM_Follow model)
 {
     return(dal.Add(model));
 }
示例#3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(XHD.Model.CRM_Follow model)
 {
     return(dal.Update(model));
 }
示例#4
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <XHD.Model.CRM_Follow> DataTableToList(DataTable dt)
        {
            List <XHD.Model.CRM_Follow> modelList = new List <XHD.Model.CRM_Follow>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                XHD.Model.CRM_Follow model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new XHD.Model.CRM_Follow();
                    if (dt.Rows[n]["id"] != null && dt.Rows[n]["id"].ToString() != "")
                    {
                        model.id = int.Parse(dt.Rows[n]["id"].ToString());
                    }
                    if (dt.Rows[n]["Customer_id"] != null && dt.Rows[n]["Customer_id"].ToString() != "")
                    {
                        model.Customer_id = int.Parse(dt.Rows[n]["Customer_id"].ToString());
                    }
                    if (dt.Rows[n]["Customer_name"] != null && dt.Rows[n]["Customer_name"].ToString() != "")
                    {
                        model.Customer_name = dt.Rows[n]["Customer_name"].ToString();
                    }
                    if (dt.Rows[n]["Follow"] != null && dt.Rows[n]["Follow"].ToString() != "")
                    {
                        model.Follow = dt.Rows[n]["Follow"].ToString();
                    }
                    if (dt.Rows[n]["Follow_date"] != null && dt.Rows[n]["Follow_date"].ToString() != "")
                    {
                        model.Follow_date = DateTime.Parse(dt.Rows[n]["Follow_date"].ToString());
                    }
                    if (dt.Rows[n]["Follow_Type_id"] != null && dt.Rows[n]["Follow_Type_id"].ToString() != "")
                    {
                        model.Follow_Type_id = int.Parse(dt.Rows[n]["Follow_Type_id"].ToString());
                    }
                    if (dt.Rows[n]["Follow_Type"] != null && dt.Rows[n]["Follow_Type"].ToString() != "")
                    {
                        model.Follow_Type = dt.Rows[n]["Follow_Type"].ToString();
                    }
                    if (dt.Rows[n]["department_id"] != null && dt.Rows[n]["department_id"].ToString() != "")
                    {
                        model.department_id = int.Parse(dt.Rows[n]["department_id"].ToString());
                    }
                    if (dt.Rows[n]["department_name"] != null && dt.Rows[n]["department_name"].ToString() != "")
                    {
                        model.department_name = dt.Rows[n]["department_name"].ToString();
                    }
                    if (dt.Rows[n]["employee_id"] != null && dt.Rows[n]["employee_id"].ToString() != "")
                    {
                        model.employee_id = int.Parse(dt.Rows[n]["employee_id"].ToString());
                    }
                    if (dt.Rows[n]["employee_name"] != null && dt.Rows[n]["employee_name"].ToString() != "")
                    {
                        model.employee_name = dt.Rows[n]["employee_name"].ToString();
                    }
                    if (dt.Rows[n]["isDelete"] != null && dt.Rows[n]["isDelete"].ToString() != "")
                    {
                        model.isDelete = int.Parse(dt.Rows[n]["isDelete"].ToString());
                    }
                    if (dt.Rows[n]["Delete_time"] != null && dt.Rows[n]["Delete_time"].ToString() != "")
                    {
                        model.Delete_time = DateTime.Parse(dt.Rows[n]["Delete_time"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }