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

            if (rowsCount > 0)
            {
                Hownet.Model.FixedAssetsOut model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Hownet.Model.FixedAssetsOut();
                    if (dt.Rows[n]["A"].ToString() != "")
                    {
                        model.A = int.Parse(dt.Rows[n]["A"].ToString());
                    }
                    if (dt.Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = int.Parse(dt.Rows[n]["ID"].ToString());
                    }
                    if (dt.Rows[n]["FAID"].ToString() != "")
                    {
                        model.FAID = int.Parse(dt.Rows[n]["FAID"].ToString());
                    }
                    if (dt.Rows[n]["OutDate"].ToString() != "")
                    {
                        model.OutDate = DateTime.Parse(dt.Rows[n]["OutDate"].ToString());
                    }
                    if (dt.Rows[n]["ExpectedBackDate"].ToString() != "")
                    {
                        model.ExpectedBackDate = DateTime.Parse(dt.Rows[n]["ExpectedBackDate"].ToString());
                    }
                    if (dt.Rows[n]["ActualBackDate"].ToString() != "")
                    {
                        model.ActualBackDate = DateTime.Parse(dt.Rows[n]["ActualBackDate"].ToString());
                    }
                    if (dt.Rows[n]["OutDeparmentID"].ToString() != "")
                    {
                        model.OutDeparmentID = int.Parse(dt.Rows[n]["OutDeparmentID"].ToString());
                    }
                    if (dt.Rows[n]["OutUserID"].ToString() != "")
                    {
                        model.OutUserID = int.Parse(dt.Rows[n]["OutUserID"].ToString());
                    }
                    if (dt.Rows[n]["VerifyManID"].ToString() != "")
                    {
                        model.VerifyManID = int.Parse(dt.Rows[n]["VerifyManID"].ToString());
                    }
                    model.Remark = dt.Rows[n]["Remark"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Example #2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Hownet.Model.FixedAssetsOut model)
 {
     return(dal.Update(model));
 }
Example #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(Hownet.Model.FixedAssetsOut model)
 {
     return(dal.Add(model));
 }