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

            if (rowsCount > 0)
            {
                LPWeb.Model.ProspectNotes model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new LPWeb.Model.ProspectNotes();
                    if (dt.Rows[n]["PropsectNoteId"].ToString() != "")
                    {
                        model.PropsectNoteId = int.Parse(dt.Rows[n]["PropsectNoteId"].ToString());
                    }
                    if (dt.Rows[n]["ContactId"].ToString() != "")
                    {
                        model.ContactId = int.Parse(dt.Rows[n]["ContactId"].ToString());
                    }
                    if (dt.Rows[n]["Created"].ToString() != "")
                    {
                        model.Created = DateTime.Parse(dt.Rows[n]["Created"].ToString());
                    }
                    model.Sender = dt.Rows[n]["Sender"].ToString();
                    model.Note   = dt.Rows[n]["Note"].ToString();
                    if (dt.Rows[n]["Exported"].ToString() != "")
                    {
                        if ((dt.Rows[n]["Exported"].ToString() == "1") || (dt.Rows[n]["Exported"].ToString().ToLower() == "true"))
                        {
                            model.Exported = true;
                        }
                        else
                        {
                            model.Exported = false;
                        }
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
예제 #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(LPWeb.Model.ProspectNotes model)
 {
     dal.Update(model);
 }
예제 #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(LPWeb.Model.ProspectNotes model)
 {
     return(dal.Add(model));
 }