public bool LoginStatus() { if (Request.Cookies["MapsUser"] != null) { userCookie = HttpContext.Request.Cookies["MapsUser"]; AdminType = (AdminType)Enum.Parse(typeof(AdminType), userCookie["Type"], true); GetEduYearId = Convert.ToInt32(userCookie["EduYearId"]); return(true); } return(false); }
public void GetWorkers_WorkerFromDAL_CorrectMappingToWorkerDTO() { // Arrange User user = new AdminType(1, "test", 1); SecurityContext.SetUser(user); var streetService = GetWorkerService(); var actualStreetDto = streetService.GetWorkers(0).First(); Assert.True( actualStreetDto.Id == 1 && actualStreetDto.Name == "TestN" ); }
public int CreateRole(AdminType role) { this.binding.GetAdminTypeRepository.Insert(role); int inserData = this.binding.Save(); if (inserData > 0) { inserData = 1; return(inserData); } else { inserData = 0; return(inserData); } }
public object adType() { DataTable dt = new DataTable(); string cmdtext = string.Format("select * from LOAI_NHAN_VIEN_"); dt = DataAccessHelper.log(cmdtext); List <AdminType> li = new List <AdminType>(); foreach (DataRow dr in dt.Rows) { AdminType ad = new AdminType(); ad.maLoaiNhanVien = dr[0].ToString(); ad.tenLoaiNhanVien = dr[1].ToString(); ad.mota = dr[2].ToString(); li.Add(ad); } return(li); }
public int AddToClubAdministration([FromBody] ClubAdministrationDTO createdAdmin) { try { var adminType = _repoWrapper.AdminType .FindByCondition(i => i.AdminTypeName == createdAdmin.AdminType).FirstOrDefault(); int AdminTypeId; if (adminType == null) { var newAdminType = new AdminType() { AdminTypeName = createdAdmin.AdminType }; _repoWrapper.AdminType.Create(newAdminType); _repoWrapper.Save(); adminType = _repoWrapper.AdminType .FindByCondition(i => i.AdminTypeName == createdAdmin.AdminType).FirstOrDefault(); AdminTypeId = adminType.ID; } else { AdminTypeId = adminType.ID; } ClubAdministration newClubAdmin = new ClubAdministration() { ClubMembersID = createdAdmin.adminId, StartDate = createdAdmin.startdate, EndDate = createdAdmin.enddate, ClubId = createdAdmin.clubIndex, AdminTypeId = AdminTypeId }; _repoWrapper.GetClubAdministration.Create(newClubAdmin); _repoWrapper.Save(); return(1); } catch (Exception e) { return(0); } }
public string Login(string username, string password) { try { AdminType x = new AdminType(); x.isLogin = false; if (username == G.adminUserName && password == G.adminPassword) { x.isLogin = true; x.adminType = G.adminType.admin; } if (username == G.supervisorUserName && password == G.supervisorPassword) { x.isLogin = true; x.adminType = G.adminType.supervisor; } return(JsonConvert.SerializeObject(x, Formatting.None)); } catch (Exception e) { return(JsonConvert.SerializeObject(e.Message, Formatting.None)); } }
// public bool Update(AdminType model) { try { StringBuilder strSql = new StringBuilder(); strSql.Append("update T_AdminType set "); strSql.Append("AdminTypeName=@AdminTypeName,"); strSql.Append("Editor=@Editor,"); strSql.Append("CreateDate=@CreateDate"); strSql.Append(" where Id=@Id"); if (DbHelperSQL.ExecuteSql(strSql.ToString(), GetSqlParameter(model)) > 0) { return(true); } else { return(false); } } catch { throw; } }
public static employeeInfo LoginEmployee(string username, string userpwd, AdminType LogType) { string sql = string.Format("select * from EmployeeInfo where EmployeeName='{0}' and EmployeePassword='******' and EmployeeType='{2}'", username, userpwd, LogType); OleDbDataReader dr = Dbhelper.ExecuteReader(sql); employeeInfo Employee = new employeeInfo(); if (dr != null) { if (dr.Read()) { Employee.Id = uint.Parse(dr[0].ToString()); Employee.Name = dr[1].ToString(); Employee.Password = dr[2].ToString(); } return(Employee); } else { return(null); } }
// public bool Create(AdminType model) { try { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into T_AdminType("); strSql.Append("AdminTypeName,Editor,CreateDate)"); strSql.Append(" values ("); strSql.Append("@AdminTypeName,@Editor,@CreateDate)"); //if (DbHelperSQL.ExecuteSql(strSql.ToString(), GetSqlParameter(model)) > 0) if (DbHelperSQL.ExecuteSql(strSql.ToString(), GetSqlParameter(model)) > 0) { return(true); } else { return(false); } } catch { throw; } }
public Admin(string username, string password, string firstName, string lastName, int ratingsCount, double averageRatingAdmin, AdminType adminType) { this.username = username; this.password = password; this.firstName = firstName; this.lastName = lastName; this.ratingsCount = ratingsCount; this.averageRating = averageRatingAdmin; this.adminType = adminType; }
public ClubAccessForClubAdminGetter(IRepositoryWrapper repositoryWrapper) { _repositoryWrapper = repositoryWrapper; _ClubAdminType = _repositoryWrapper.AdminType.GetFirstAsync( predicate: a => a.AdminTypeName == "Голова Куреня").Result; }
/// <summary> /// 修改锁定状态 /// </summary> /// <param name="uId"></param> /// <param name="adminType"></param> /// <returns></returns> public Task <Resp> SetAdminType(string uId, AdminType adminType) { return(AdminInfoRep.Instance.SetAdminType(uId, adminType)); }
public RegionAccessForRegionAdminGetter(IRepositoryWrapper repositoryWrapper) { _repositoryWrapper = repositoryWrapper; _RegionAdminType = _repositoryWrapper.AdminType.GetFirstAsync( predicate: a => a.AdminTypeName == "Голова Округу").Result; }
public CityAccessForCityAdminGetter(IRepositoryWrapper repositoryWrapper) { _repositoryWrapper = repositoryWrapper; _cityAdminType = _repositoryWrapper.AdminType.GetFirstAsync( predicate: a => a.AdminTypeName == "Голова Станиці").Result; }
/// <summary> /// 统计报表 /// </summary> /// <param name="start"></param> /// <param name="end"></param> /// <param name="type"></param> /// <param name="dt"></param> /// <returns></returns> public string GetReport(int firsttype, int secondtype, int dealer, int store, DateTime start, DateTime end, AdminType type, int Id, out DataSet ds) { ds = new DataSet(); try { if (type == AdminType.Managers) { ds = rb.GetAdminReportInfo(firsttype, secondtype, dealer, store, start, end, Id); } if (type == AdminType.Dealer) { ds = rb.GetAdminReportInfo(firsttype, secondtype, Id, store, start, end, Id); } if (type == AdminType.Stores) { ds = rb.GetAdminReportInfo(firsttype, secondtype, 0, Id, start, end, Id); } return(Config.Success); } catch (Exception ex) { WriteLog.WriteExceptionLog("ReportBLL.GetReport()", ex); return(Config.ExceptionMsg); } }