Ejemplo n.º 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <Daiv_OA.Entity.MessageEntity> GetModelList(string strWhere)
        {
            DataSet ds = dal.GetList(strWhere);
            List <Daiv_OA.Entity.MessageEntity> modelList = new List <Daiv_OA.Entity.MessageEntity>();
            int rowsCount = ds.Tables[0].Rows.Count;

            if (rowsCount > 0)
            {
                Daiv_OA.Entity.MessageEntity model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Daiv_OA.Entity.MessageEntity();
                    if (ds.Tables[0].Rows[n]["Mid"].ToString() != "")
                    {
                        model.Mid = int.Parse(ds.Tables[0].Rows[n]["Mid"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["ToUid"].ToString() != "")
                    {
                        model.ToUid = int.Parse(ds.Tables[0].Rows[n]["ToUid"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["FromUid"].ToString() != "")
                    {
                        model.FromUid = int.Parse(ds.Tables[0].Rows[n]["FromUid"].ToString());
                    }
                    model.Mtitle  = ds.Tables[0].Rows[n]["Mtitle"].ToString();
                    model.Content = ds.Tables[0].Rows[n]["Content"].ToString();
                    if (ds.Tables[0].Rows[n]["Addtime"].ToString() != "")
                    {
                        model.Addtime = DateTime.Parse(ds.Tables[0].Rows[n]["Addtime"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["touser"].ToString() != "")
                    {
                        model.Touser = (ds.Tables[0].Rows[n]["touser"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(Daiv_OA.Entity.MessageEntity model)
 {
     dal.Update(model);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(Daiv_OA.Entity.MessageEntity model)
 {
     return(dal.Add(model));
 }