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

            if (rowsCount > 0)
            {
                LPWeb.Model.ContactRoles model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new LPWeb.Model.ContactRoles();
                    if (dt.Rows[n]["ContactRoleId"].ToString() != "")
                    {
                        model.ContactRoleId = int.Parse(dt.Rows[n]["ContactRoleId"].ToString());
                    }
                    model.Name = dt.Rows[n]["Name"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemple #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(LPWeb.Model.ContactRoles model)
 {
     dal.Update(model);
 }
Exemple #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(LPWeb.Model.ContactRoles model)
 {
     return(dal.Add(model));
 }