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

            if (rowsCount > 0)
            {
                LPWeb.Model.UserLeadDist model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new LPWeb.Model.UserLeadDist();
                    if (dt.Rows[n]["UserID"].ToString() != "")
                    {
                        model.UserID = int.Parse(dt.Rows[n]["UserID"].ToString());
                    }
                    if (dt.Rows[n]["EnableLeadRouting"].ToString() != "")
                    {
                        if ((dt.Rows[n]["EnableLeadRouting"].ToString() == "1") || (dt.Rows[n]["EnableLeadRouting"].ToString().ToLower() == "true"))
                        {
                            model.EnableLeadRouting = true;
                        }
                        else
                        {
                            model.EnableLeadRouting = false;
                        }
                    }
                    if (dt.Rows[n]["MaxDailyLeads"].ToString() != "")
                    {
                        model.MaxDailyLeads = int.Parse(dt.Rows[n]["MaxDailyLeads"].ToString());
                    }
                    if (dt.Rows[n]["LeadsAssignedToday"].ToString() != "")
                    {
                        model.LeadsAssignedToday = int.Parse(dt.Rows[n]["LeadsAssignedToday"].ToString());
                    }
                    if (dt.Rows[n]["LastLeadAssigned"].ToString() != "")
                    {
                        model.LastLeadAssigned = int.Parse(dt.Rows[n]["LastLeadAssigned"].ToString());
                    }
                    if (dt.Rows[n]["LastAssigned"].ToString() != "")
                    {
                        model.LastAssigned = DateTime.Parse(dt.Rows[n]["LastAssigned"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
예제 #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(LPWeb.Model.UserLeadDist model)
 {
     return(dal.Update(model));
 }
예제 #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(LPWeb.Model.UserLeadDist model)
 {
     dal.Add(model);
 }