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

            if (rowsCount > 0)
            {
                MobileSoft.Model.OAPublicWork.Tb_OAPublicWork_ContractInfo model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new MobileSoft.Model.OAPublicWork.Tb_OAPublicWork_ContractInfo();
                    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.UserCode      = dt.Rows[n]["UserCode"].ToString();
                    model.ContractCode  = dt.Rows[n]["ContractCode"].ToString();
                    model.ContractName  = dt.Rows[n]["ContractName"].ToString();
                    model.CompanyName   = dt.Rows[n]["CompanyName"].ToString();
                    model.ContractMoney = dt.Rows[n]["ContractMoney"].ToString();
                    model.Writer        = dt.Rows[n]["Writer"].ToString();
                    if (dt.Rows[n]["WriteDate"].ToString() != "")
                    {
                        model.WriteDate = DateTime.Parse(dt.Rows[n]["WriteDate"].ToString());
                    }
                    if (dt.Rows[n]["OverDate"].ToString() != "")
                    {
                        model.OverDate = DateTime.Parse(dt.Rows[n]["OverDate"].ToString());
                    }
                    if (dt.Rows[n]["ContractDate"].ToString() != "")
                    {
                        model.ContractDate = DateTime.Parse(dt.Rows[n]["ContractDate"].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);
        }
Beispiel #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(MobileSoft.Model.OAPublicWork.Tb_OAPublicWork_ContractInfo model)
 {
     dal.Update(model);
 }
Beispiel #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(MobileSoft.Model.OAPublicWork.Tb_OAPublicWork_ContractInfo model)
 {
     return(dal.Add(model));
 }