/// <summary> /// 获取邀请用户的UserId /// </summary> /// <param name="userId"></param> /// <returns></returns> public int GetInviteUserId(int userId) { ColoPay.Model.Members.Users userModel = GetInviteUser(userId); return(userModel == null ? 0 : userModel.UserID); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(ColoPay.Model.Members.Users model) { return(dal.Add(model)); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(ColoPay.Model.Members.Users model) { return(dal.Update(model)); }
/// <summary> /// 获得数据列表 /// </summary> public List <Model.Members.Users> DataTableToList(DataTable dt) { List <ColoPay.Model.Members.Users> modelList = new List <ColoPay.Model.Members.Users>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { ColoPay.Model.Members.Users model; for (int n = 0; n < rowsCount; n++) { model = new ColoPay.Model.Members.Users(); if (dt.Rows[n]["UserID"] != null && dt.Rows[n]["UserID"].ToString() != "") { model.UserID = int.Parse(dt.Rows[n]["UserID"].ToString()); } if (dt.Rows[n]["UserName"] != null && dt.Rows[n]["UserName"].ToString() != "") { model.UserName = dt.Rows[n]["UserName"].ToString(); } if (dt.Rows[n]["NickName"] != null && dt.Rows[n]["NickName"].ToString() != "") { model.NickName = dt.Rows[n]["NickName"].ToString(); } if (dt.Rows[n]["Password"] != null && dt.Rows[n]["Password"].ToString() != "") { model.Password = (byte[])dt.Rows[n]["Password"]; } if (dt.Rows[n]["TrueName"] != null && dt.Rows[n]["TrueName"].ToString() != "") { model.TrueName = dt.Rows[n]["TrueName"].ToString(); } if (dt.Rows[n]["Sex"] != null && dt.Rows[n]["Sex"].ToString() != "") { model.Sex = dt.Rows[n]["Sex"].ToString(); } if (dt.Rows[n]["Phone"] != null && dt.Rows[n]["Phone"].ToString() != "") { model.Phone = dt.Rows[n]["Phone"].ToString(); } if (dt.Rows[n]["Email"] != null && dt.Rows[n]["Email"].ToString() != "") { model.Email = dt.Rows[n]["Email"].ToString(); } if (dt.Rows[n]["EmployeeID"] != null && dt.Rows[n]["EmployeeID"].ToString() != "") { model.EmployeeID = int.Parse(dt.Rows[n]["EmployeeID"].ToString()); } if (dt.Rows[n]["DepartmentID"] != null && dt.Rows[n]["DepartmentID"].ToString() != "") { model.DepartmentID = dt.Rows[n]["DepartmentID"].ToString(); } if (dt.Rows[n]["Activity"] != null && dt.Rows[n]["Activity"].ToString() != "") { if ((dt.Rows[n]["Activity"].ToString() == "1") || (dt.Rows[n]["Activity"].ToString().ToLower() == "true")) { model.Activity = true; } else { model.Activity = false; } } if (dt.Rows[n]["UserType"] != null && dt.Rows[n]["UserType"].ToString() != "") { model.UserType = dt.Rows[n]["UserType"].ToString(); } if (dt.Rows[n]["Style"] != null && dt.Rows[n]["Style"].ToString() != "") { model.Style = int.Parse(dt.Rows[n]["Style"].ToString()); } if (dt.Rows[n]["User_iCreator"] != null && dt.Rows[n]["User_iCreator"].ToString() != "") { model.User_iCreator = int.Parse(dt.Rows[n]["User_iCreator"].ToString()); } if (dt.Rows[n]["User_dateCreate"] != null && dt.Rows[n]["User_dateCreate"].ToString() != "") { model.User_dateCreate = DateTime.Parse(dt.Rows[n]["User_dateCreate"].ToString()); } if (dt.Rows[n]["User_dateValid"] != null && dt.Rows[n]["User_dateValid"].ToString() != "") { model.User_dateValid = DateTime.Parse(dt.Rows[n]["User_dateValid"].ToString()); } if (dt.Rows[n]["User_dateExpire"] != null && dt.Rows[n]["User_dateExpire"].ToString() != "") { model.User_dateExpire = DateTime.Parse(dt.Rows[n]["User_dateExpire"].ToString()); } if (dt.Rows[n]["User_iApprover"] != null && dt.Rows[n]["User_iApprover"].ToString() != "") { model.User_iApprover = int.Parse(dt.Rows[n]["User_iApprover"].ToString()); } if (dt.Rows[n]["User_dateApprove"] != null && dt.Rows[n]["User_dateApprove"].ToString() != "") { model.User_dateApprove = DateTime.Parse(dt.Rows[n]["User_dateApprove"].ToString()); } if (dt.Rows[n]["User_iApproveState"] != null && dt.Rows[n]["User_iApproveState"].ToString() != "") { model.User_iApproveState = int.Parse(dt.Rows[n]["User_iApproveState"].ToString()); } if (dt.Rows[n]["User_cLang"] != null && dt.Rows[n]["User_cLang"].ToString() != "") { model.User_cLang = dt.Rows[n]["User_cLang"].ToString(); } modelList.Add(model); } } return(modelList); }