Exemplo n.º 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <Maticsoft.Model.Operation_log> DataTableToList(DataTable dt)
        {
            List <Maticsoft.Model.Operation_log> modelList = new List <Maticsoft.Model.Operation_log>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                Maticsoft.Model.Operation_log model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Maticsoft.Model.Operation_log();
                    if (dt.Rows[n]["R_ID"] != null && dt.Rows[n]["R_ID"].ToString() != "")
                    {
                        model.R_ID = decimal.Parse(dt.Rows[n]["R_ID"].ToString());
                    }
                    if (dt.Rows[n]["UserName"] != null && dt.Rows[n]["UserName"].ToString() != "")
                    {
                        model.UserName = dt.Rows[n]["UserName"].ToString();
                    }
                    if (dt.Rows[n]["Operation"] != null && dt.Rows[n]["Operation"].ToString() != "")
                    {
                        model.Operation = dt.Rows[n]["Operation"].ToString();
                    }
                    if (dt.Rows[n]["Remarks"] != null && dt.Rows[n]["Remarks"].ToString() != "")
                    {
                        model.Remarks = dt.Rows[n]["Remarks"].ToString();
                    }
                    if (dt.Rows[n]["DateTime"] != null && dt.Rows[n]["DateTime"].ToString() != "")
                    {
                        model.DateTime = DateTime.Parse(dt.Rows[n]["DateTime"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Maticsoft.Model.Operation_log model)
 {
     return(dal.Update(model));
 }
Exemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public decimal Add(Maticsoft.Model.Operation_log model)
 {
     return(dal.Add(model));
 }