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

            if (rowsCount > 0)
            {
                MobileSoft.Model.Management.Tb_Management_Type model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model          = new MobileSoft.Model.Management.Tb_Management_Type();
                    model.Code     = dt.Rows[n]["Code"].ToString();
                    model.SortCode = dt.Rows[n]["SortCode"].ToString();
                    if (dt.Rows[n]["Sort"].ToString() != "")
                    {
                        model.Sort = int.Parse(dt.Rows[n]["Sort"].ToString());
                    }
                    model.TypeName = dt.Rows[n]["TypeName"].ToString();
                    model.TypeCode = dt.Rows[n]["TypeCode"].ToString();
                    model.Memo     = dt.Rows[n]["Memo"].ToString();
                    if (dt.Rows[n]["IsDelete"].ToString() != "")
                    {
                        model.IsDelete = int.Parse(dt.Rows[n]["IsDelete"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
예제 #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(MobileSoft.Model.Management.Tb_Management_Type model)
 {
     dal.Update(model);
 }
예제 #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(MobileSoft.Model.Management.Tb_Management_Type model)
 {
     dal.Add(model);
 }