Esempio n. 1
0
		/// <summary>
		/// 获得数据列表
		/// </summary>
		public List<MobileSoft.Model.Common.Tb_Common_TelList> DataTableToList(DataTable dt)
		{
			List<MobileSoft.Model.Common.Tb_Common_TelList> modelList = new List<MobileSoft.Model.Common.Tb_Common_TelList>();
			int rowsCount = dt.Rows.Count;
			if (rowsCount > 0)
			{
				MobileSoft.Model.Common.Tb_Common_TelList model;
				for (int n = 0; n < rowsCount; n++)
				{
					model = new MobileSoft.Model.Common.Tb_Common_TelList();
					//model.InfoId=dt.Rows[n]["InfoId"].ToString();
					model.UserCode=dt.Rows[n]["UserCode"].ToString();
					model.TelNum=dt.Rows[n]["TelNum"].ToString();
					model.Mark=dt.Rows[n]["Mark"].ToString();
					model.Duty=dt.Rows[n]["Duty"].ToString();
					if(dt.Rows[n]["Sort"].ToString()!="")
					{
						model.Sort=int.Parse(dt.Rows[n]["Sort"].ToString());
					}
					model.Phone=dt.Rows[n]["Phone"].ToString();
					model.Mail=dt.Rows[n]["Mail"].ToString();
					model.CompanyName=dt.Rows[n]["CompanyName"].ToString();
					model.CommName=dt.Rows[n]["CommName"].ToString();
					model.OprName=dt.Rows[n]["OprName"].ToString();
					if(dt.Rows[n]["CompanyNameSort"].ToString()!="")
					{
						model.CompanyNameSort=int.Parse(dt.Rows[n]["CompanyNameSort"].ToString());
					}
					if(dt.Rows[n]["CommNameSort"].ToString()!="")
					{
						model.CommNameSort=int.Parse(dt.Rows[n]["CommNameSort"].ToString());
					}
					if(dt.Rows[n]["DutySort"].ToString()!="")
					{
						model.DutySort=int.Parse(dt.Rows[n]["DutySort"].ToString());
					}
					modelList.Add(model);
				}
			}
			return modelList;
		}
Esempio n. 2
0
		/// <summary>
		/// 更新一条数据
		/// </summary>
		public void Update(MobileSoft.Model.Common.Tb_Common_TelList model)
		{
			dal.Update(model);
		}
Esempio n. 3
0
		/// <summary>
		/// 增加一条数据
		/// </summary>
		public void Add(MobileSoft.Model.Common.Tb_Common_TelList model)
		{
			dal.Add(model);
		}