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

            if (rowsCount > 0)
            {
                MobileSoft.Model.OAPublicWork.Tb_OAPublicWork_OfficialDocument model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new MobileSoft.Model.OAPublicWork.Tb_OAPublicWork_OfficialDocument();
                    if (dt.Rows[n]["InfoId"].ToString() != "")
                    {
                        model.InfoId = int.Parse(dt.Rows[n]["InfoId"].ToString());
                    }
                    if (dt.Rows[n]["Tb_WorkFlow_FlowSort_InfoId"].ToString() != "")
                    {
                        model.Tb_WorkFlow_FlowSort_InfoId = int.Parse(dt.Rows[n]["Tb_WorkFlow_FlowSort_InfoId"].ToString());
                    }
                    model.UserName      = dt.Rows[n]["UserName"].ToString();
                    model.FileCode      = dt.Rows[n]["FileCode"].ToString();
                    model.FileTitle     = dt.Rows[n]["FileTitle"].ToString();
                    model.DispatchUnits = dt.Rows[n]["DispatchUnits"].ToString();
                    model.Writer        = dt.Rows[n]["Writer"].ToString();
                    if (dt.Rows[n]["WriteDate"].ToString() != "")
                    {
                        model.WriteDate = DateTime.Parse(dt.Rows[n]["WriteDate"].ToString());
                    }
                    model.ReciveUnits = dt.Rows[n]["ReciveUnits"].ToString();
                    model.FileSecret  = dt.Rows[n]["FileSecret"].ToString();
                    model.Nervous     = dt.Rows[n]["Nervous"].ToString();
                    model.KeyWords    = dt.Rows[n]["KeyWords"].ToString();
                    model.InfoContent = dt.Rows[n]["InfoContent"].ToString();
                    model.DocumentUrl = dt.Rows[n]["DocumentUrl"].ToString();
                    if (dt.Rows[n]["WorkStartDate"].ToString() != "")
                    {
                        model.WorkStartDate = DateTime.Parse(dt.Rows[n]["WorkStartDate"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(MobileSoft.Model.OAPublicWork.Tb_OAPublicWork_OfficialDocument model)
 {
     dal.Update(model);
 }
Exemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(MobileSoft.Model.OAPublicWork.Tb_OAPublicWork_OfficialDocument model)
 {
     return(dal.Add(model));
 }