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

            if (rowsCount > 0)
            {
                Daiv_OA.Entity.TaskEntity model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Daiv_OA.Entity.TaskEntity();
                    if (ds.Tables[0].Rows[n]["Tlid"].ToString() != "")
                    {
                        model.Tlid = int.Parse(ds.Tables[0].Rows[n]["Tlid"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["Uid"].ToString() != "")
                    {
                        model.Uid = int.Parse(ds.Tables[0].Rows[n]["Uid"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["Manager"].ToString() != "")
                    {
                        model.Manager = ds.Tables[0].Rows[n]["Manager"].ToString();
                    }
                    model.Tasktitle = ds.Tables[0].Rows[n]["Tasktitle"].ToString();
                    model.Content   = ds.Tables[0].Rows[n]["Content"].ToString();
                    if (ds.Tables[0].Rows[n]["Nowtime"].ToString() != "")
                    {
                        model.Nowtime = DateTime.Parse(ds.Tables[0].Rows[n]["Nowtime"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["Plantime"].ToString() != "")
                    {
                        model.Plantime = DateTime.Parse(ds.Tables[0].Rows[n]["Plantime"].ToString());
                    }
                    model.Ttype = ds.Tables[0].Rows[n]["Ttype"].ToString();
                    if (ds.Tables[0].Rows[n]["Worktime"].ToString() != "")
                    {
                        model.Worktime = DateTime.Parse(ds.Tables[0].Rows[n]["Worktime"].ToString());
                    }
                    model.Workprogress = int.Parse(ds.Tables[0].Rows[n]["Workprogress"].ToString());
                    model.Workstate    = ds.Tables[0].Rows[n]["Workstate"].ToString();

                    model.Sumtime      = int.Parse(ds.Tables[0].Rows[n]["sumtime"].ToString());
                    model.Progresstime = int.Parse(ds.Tables[0].Rows[n]["progresstime"].ToString());
                    model.Classse      = ds.Tables[0].Rows[n]["classse"].ToString();
                    model.Remark       = ds.Tables[0].Rows[n]["remark"].ToString();
                    model.Newnote      = ds.Tables[0].Rows[n]["newnote"].ToString();

                    model.Filepath = ds.Tables[0].Rows[n]["filepath"].ToString();
                    model.Question = ds.Tables[0].Rows[n]["question"].ToString();


                    modelList.Add(model);
                }
            }
            return(modelList);
        }
示例#2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(Daiv_OA.Entity.TaskEntity model)
 {
     dal.Update(model);
 }
示例#3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(Daiv_OA.Entity.TaskEntity model)
 {
     return(dal.Add(model));
 }