Пример #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <MobileSoft.Model.Common.Tb_Common_CommonInfo> DataTableToList(DataTable dt)
        {
            List <MobileSoft.Model.Common.Tb_Common_CommonInfo> modelList = new List <MobileSoft.Model.Common.Tb_Common_CommonInfo>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                MobileSoft.Model.Common.Tb_Common_CommonInfo model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new MobileSoft.Model.Common.Tb_Common_CommonInfo();
                    //model.IID=dt.Rows[n]["IID"].ToString();
                    model.DepCode   = dt.Rows[n]["DepCode"].ToString();
                    model.OrganCode = dt.Rows[n]["OrganCode"].ToString();
                    model.TypeCode  = dt.Rows[n]["TypeCode"].ToString();
                    model.Title     = dt.Rows[n]["Title"].ToString();
                    model.Content   = dt.Rows[n]["Content"].ToString();
                    model.UserName  = dt.Rows[n]["UserName"].ToString();
                    if (dt.Rows[n]["IssueDate"].ToString() != "")
                    {
                        model.IssueDate = DateTime.Parse(dt.Rows[n]["IssueDate"].ToString());
                    }
                    model.Type             = dt.Rows[n]["Type"].ToString();
                    model.ReadDepartName   = dt.Rows[n]["ReadDepartName"].ToString();
                    model.ReadDepartCode   = dt.Rows[n]["ReadDepartCode"].ToString();
                    model.ReadUserName     = dt.Rows[n]["ReadUserName"].ToString();
                    model.ReadUserCode     = dt.Rows[n]["ReadUserCode"].ToString();
                    model.HaveReadUserName = dt.Rows[n]["HaveReadUserName"].ToString();
                    model.HaveReadUserCode = dt.Rows[n]["HaveReadUserCode"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Пример #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(MobileSoft.Model.Common.Tb_Common_CommonInfo model)
 {
     dal.Update(model);
 }
Пример #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(MobileSoft.Model.Common.Tb_Common_CommonInfo model)
 {
     return(dal.Add(model));
 }