/// <summary> /// 获得数据列表 /// </summary> public List <JMP.MDL.CoBusinessPersonnel> DataTableToList(DataTable dt) { List <JMP.MDL.CoBusinessPersonnel> modelList = new List <JMP.MDL.CoBusinessPersonnel>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { JMP.MDL.CoBusinessPersonnel model; for (int n = 0; n < rowsCount; n++) { model = new JMP.MDL.CoBusinessPersonnel(); if (dt.Rows[n]["Id"].ToString() != "") { model.Id = int.Parse(dt.Rows[n]["Id"].ToString()); } if (dt.Rows[n]["CreatedById"].ToString() != "") { model.CreatedById = int.Parse(dt.Rows[n]["CreatedById"].ToString()); } model.CreatedByName = dt.Rows[n]["CreatedByName"].ToString(); if (dt.Rows[n]["LoginCount"].ToString() != "") { model.LoginCount = int.Parse(dt.Rows[n]["LoginCount"].ToString()); } if (dt.Rows[n]["State"].ToString() != "") { model.State = int.Parse(dt.Rows[n]["State"].ToString()); } if (dt.Rows[n]["RoleId"].ToString() != "") { model.RoleId = int.Parse(dt.Rows[n]["RoleId"].ToString()); } if (dt.Rows[n]["CreatedOn"].ToString() != "") { model.CreatedOn = DateTime.Parse(dt.Rows[n]["CreatedOn"].ToString()); } model.LoginName = dt.Rows[n]["LoginName"].ToString(); model.Password = dt.Rows[n]["Password"].ToString(); model.DisplayName = dt.Rows[n]["DisplayName"].ToString(); model.EmailAddress = dt.Rows[n]["EmailAddress"].ToString(); model.MobilePhone = dt.Rows[n]["MobilePhone"].ToString(); model.QQ = dt.Rows[n]["QQ"].ToString(); model.Website = dt.Rows[n]["Website"].ToString(); if (dt.Rows[n]["LogintTime"].ToString() != "") { model.LogintTime = DateTime.Parse(dt.Rows[n]["LogintTime"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(JMP.MDL.CoBusinessPersonnel model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(JMP.MDL.CoBusinessPersonnel model) { return(dal.Add(model)); }