示例#1
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(Dianda.Model.Project_Projects model)
 {
     return(dal.Add(model));
 }
示例#2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(Dianda.Model.Project_Projects model)
 {
     dal.Update(model);
 }
示例#3
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <Dianda.Model.Project_Projects> DataTableToList(DataTable dt)
        {
            List <Dianda.Model.Project_Projects> modelList = new List <Dianda.Model.Project_Projects>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                Dianda.Model.Project_Projects model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Dianda.Model.Project_Projects();
                    if (dt.Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = int.Parse(dt.Rows[n]["ID"].ToString());
                    }
                    model.NAMES = dt.Rows[n]["NAMES"].ToString();
                    if (dt.Rows[n]["DELFLAG"].ToString() != "")
                    {
                        model.DELFLAG = int.Parse(dt.Rows[n]["DELFLAG"].ToString());
                    }
                    if (dt.Rows[n]["Status"].ToString() != "")
                    {
                        model.Status = int.Parse(dt.Rows[n]["Status"].ToString());
                    }
                    model.LeaderID        = dt.Rows[n]["LeaderID"].ToString();
                    model.DepartmentID    = dt.Rows[n]["DepartmentID"].ToString();
                    model.DepartmentNames = dt.Rows[n]["DepartmentNames"].ToString();
                    if (dt.Rows[n]["StartTime"].ToString() != "")
                    {
                        model.StartTime = DateTime.Parse(dt.Rows[n]["StartTime"].ToString());
                    }
                    if (dt.Rows[n]["EndTime"].ToString() != "")
                    {
                        model.EndTime = DateTime.Parse(dt.Rows[n]["EndTime"].ToString());
                    }
                    if (dt.Rows[n]["CashTotal"].ToString() != "")
                    {
                        model.CashTotal = decimal.Parse(dt.Rows[n]["CashTotal"].ToString());
                    }
                    if (dt.Rows[n]["CashCardID"].ToString() != "")
                    {
                        model.CashCardID = int.Parse(dt.Rows[n]["CashCardID"].ToString());
                    }
                    model.Overviews   = dt.Rows[n]["Overviews"].ToString();
                    model.Attachments = dt.Rows[n]["Attachments"].ToString();
                    if (dt.Rows[n]["DATETIME"].ToString() != "")
                    {
                        model.DATETIME = DateTime.Parse(dt.Rows[n]["DATETIME"].ToString());
                    }
                    model.SendUserID = dt.Rows[n]["SendUserID"].ToString();
                    model.DoUserID   = dt.Rows[n]["DoUserID"].ToString();
                    if (dt.Rows[n]["ReadTime"].ToString() != "")
                    {
                        model.ReadTime = DateTime.Parse(dt.Rows[n]["ReadTime"].ToString());
                    }
                    model.DoNote = dt.Rows[n]["DoNote"].ToString();
                    if (dt.Rows[n]["ColumnsID"].ToString() != "")
                    {
                        model.ColumnsID = int.Parse(dt.Rows[n]["ColumnsID"].ToString());
                    }
                    model.CashDw = dt.Rows[n]["CashDw"].ToString();
                    if (dt.Rows[n]["ProjectType"].ToString() != "")
                    {
                        model.ProjectType = int.Parse(dt.Rows[n]["ProjectType"].ToString());
                    }
                    model.BudgetList = dt.Rows[n]["BudgetList"].ToString();
                    model.TEMP1      = dt.Rows[n]["TEMP1"].ToString();
                    model.TEMP2      = dt.Rows[n]["TEMP2"].ToString();
                    model.TEMP3      = dt.Rows[n]["TEMP3"].ToString();
                    model.TEMP4      = dt.Rows[n]["TEMP4"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }