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

            if (rowsCount > 0)
            {
                Maticsoft.Model.W_Receivestate model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Maticsoft.Model.W_Receivestate();
                    if (dt.Rows[n]["Id"].ToString() != "")
                    {
                        model.Id = int.Parse(dt.Rows[n]["Id"].ToString());
                    }
                    if (dt.Rows[n]["MaterialId"].ToString() != "")
                    {
                        model.MaterialId = int.Parse(dt.Rows[n]["MaterialId"].ToString());
                    }
                    model.ReceiverId = dt.Rows[n]["ReceiverId"].ToString();
                    model.Dormacy    = dt.Rows[n]["Dormacy"].ToString();
                    if (dt.Rows[n]["IssureTime"].ToString() != "")
                    {
                        model.IssureTime = DateTime.Parse(dt.Rows[n]["IssureTime"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Example #2
0
		/// <summary>
		/// 获得数据列表
		/// </summary>
		public List<Maticsoft.Model.W_Receivestate> DataTableToList(DataTable dt)
		{
			List<Maticsoft.Model.W_Receivestate> modelList = new List<Maticsoft.Model.W_Receivestate>();
			int rowsCount = dt.Rows.Count;
			if (rowsCount > 0)
			{
				Maticsoft.Model.W_Receivestate model;
				for (int n = 0; n < rowsCount; n++)
				{
					model = new Maticsoft.Model.W_Receivestate();
					if(dt.Rows[n]["Id"].ToString()!="")
					{
						model.Id=int.Parse(dt.Rows[n]["Id"].ToString());
					}
					if(dt.Rows[n]["MaterialId"].ToString()!="")
					{
						model.MaterialId=int.Parse(dt.Rows[n]["MaterialId"].ToString());
					}
					model.ReceiverId=dt.Rows[n]["ReceiverId"].ToString();
					model.Dormacy=dt.Rows[n]["Dormacy"].ToString();
					if(dt.Rows[n]["IssureTime"].ToString()!="")
					{
						model.IssureTime=DateTime.Parse(dt.Rows[n]["IssureTime"].ToString());
					}
					modelList.Add(model);
				}
			}
			return modelList;
		}
Example #3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(Maticsoft.Model.W_Receivestate model)
 {
     dal.Update(model);
 }
Example #4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(Maticsoft.Model.W_Receivestate model)
 {
     return(dal.Add(model));
 }