/// <summary> /// 增加一条数据 /// </summary> public void Add(Dianda.Model.USER_Users model) { dal.Add(model); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(Dianda.Model.USER_Users model) { dal.Update(model); }
/// <summary> /// 获得数据列表 /// </summary> public List <Dianda.Model.USER_Users> DataTableToList(DataTable dt) { List <Dianda.Model.USER_Users> modelList = new List <Dianda.Model.USER_Users>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Dianda.Model.USER_Users model; for (int n = 0; n < rowsCount; n++) { model = new Dianda.Model.USER_Users(); model.ID = dt.Rows[n]["ID"].ToString(); model.USERNAME = dt.Rows[n]["USERNAME"].ToString(); model.PASSWORD = dt.Rows[n]["PASSWORD"].ToString(); model.REALNAME = dt.Rows[n]["REALNAME"].ToString(); model.SEX = dt.Rows[n]["SEX"].ToString(); model.DepartMentID = dt.Rows[n]["DepartMentID"].ToString(); model.StationID = dt.Rows[n]["StationID"].ToString(); model.TEL = dt.Rows[n]["TEL"].ToString(); model.EMAIL = dt.Rows[n]["EMAIL"].ToString(); if (dt.Rows[n]["Holidays"].ToString() != "") { model.Holidays = int.Parse(dt.Rows[n]["Holidays"].ToString()); } model.WorkStats = dt.Rows[n]["WorkStats"].ToString(); if (dt.Rows[n]["DatesEmployed"].ToString() != "") { model.DatesEmployed = DateTime.Parse(dt.Rows[n]["DatesEmployed"].ToString()); } if (dt.Rows[n]["LeaveDates"].ToString() != "") { model.LeaveDates = DateTime.Parse(dt.Rows[n]["LeaveDates"].ToString()); } model.BIRTHDAY = dt.Rows[n]["BIRTHDAY"].ToString(); model.NativePlace = dt.Rows[n]["NativePlace"].ToString(); model.EducationLevel = dt.Rows[n]["EducationLevel"].ToString(); model.ADDRESS = dt.Rows[n]["ADDRESS"].ToString(); model.GraduateSchool = dt.Rows[n]["GraduateSchool"].ToString(); model.Major = dt.Rows[n]["Major"].ToString(); model.TrackRecord = dt.Rows[n]["TrackRecord"].ToString(); if (dt.Rows[n]["DATETIME"].ToString() != "") { model.DATETIME = DateTime.Parse(dt.Rows[n]["DATETIME"].ToString()); } model.GROUPS = dt.Rows[n]["GROUPS"].ToString(); if (dt.Rows[n]["DELFLAG"].ToString() != "") { model.DELFLAG = int.Parse(dt.Rows[n]["DELFLAG"].ToString()); } model.IMAGES = dt.Rows[n]["IMAGES"].ToString(); if (dt.Rows[n]["IsManager"].ToString() != "") { model.IsManager = int.Parse(dt.Rows[n]["IsManager"].ToString()); } model.TEMP1 = dt.Rows[n]["TEMP1"].ToString(); model.TEMP2 = dt.Rows[n]["TEMP2"].ToString(); model.TEMP3 = dt.Rows[n]["TEMP3"].ToString(); model.TEMP4 = dt.Rows[n]["TEMP4"].ToString(); model.DepartMentName = dt.Rows[n]["DepartMentName"].ToString(); modelList.Add(model); } } return(modelList); }