public virtual ActionResult CouncilAll() { var searchType = new SelectList(EnumerationService.GetEnumValues <SearchType>(), "Value", "Text"); TempData["SearchType"] = searchType; return(View()); }
public virtual ActionResult Index() { var enumUserType = EnumerationService.GetEnumValues <UserType>(); var enumUserTypeList = new SelectList(enumUserType, "Value", "Text"); ViewData["UserType"] = enumUserTypeList; return(View()); }
public virtual ActionResult Index() { var enumAuthenticationType = EnumerationService.GetEnumValues <AuthenticationType>(); enumAuthenticationType.RemoveRange(0, 3); var enumAuthenticationTypeList = new SelectList(enumAuthenticationType, "Value", "Text"); ViewData["AuthenticationType"] = enumAuthenticationTypeList; return(View()); }
public virtual ActionResult AddorUpdate(Settings settings, HttpPostedFileBase fileLogo) { try { if (!ModelState.IsValid) { ModelState.AddModelError("", "ورودی نامعتبر"); return(View(MVC.Admin.Settings.Views.Index, settings)); } using (var scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled)) { var path = Server.MapPath("~\\Content\\Images\\Logo\\"); // ذخیره لوگو if (fileLogo != null) { if (Useful.CreateFolderIfNeeded(Server.MapPath("~/Content/Images/Logo"))) { // اگر قبلا فایل وجود دارد حذف شود if (System.IO.File.Exists(path + settings.University.Logo)) { System.IO.File.Delete(path + settings.University.Logo); } if (settings.University.Logo == null) { path += Guid.NewGuid() + Path.GetExtension(fileLogo.FileName); } else { path += settings.University.Logo; } fileLogo.SaveAs(path); settings.University.Logo = Path.GetFileName(path); } } UpgradeWebconfig(settings.SmtpFrom, settings.SmtpHost, settings.SmtpUserName, settings.SmtpPass, Convert.ToInt32(settings.SmtpPort)); var data = _settingService.AddOrUpdateSettings(settings); scope.Complete(); var ordinal = EnumerationService.GetEnumValues <Ordinal>(); var genderList = new SelectList(ordinal, "Value", "Text"); TempData["Ordinal"] = genderList; return(RedirectToAction(MVC.Admin.Settings.Index())); } } catch (Exception e) { ModelState.AddModelError("", " خطا در ثبت تنظیمات عمومی"); return(View(MVC.Admin.Settings.Views.Index, settings)); } }
public virtual ActionResult Index() { var settings = _settingService.GetSettings(); var ordinal = EnumerationService.GetEnumValues <Ordinal>(); var genderList = new SelectList(ordinal, "Value", "Text"); TempData["Ordinal"] = genderList; return(View(settings)); }
public virtual ActionResult Create() { var userId = long.Parse(User.Identity.GetUserId()); var enumGrade = EnumerationService.GetEnumValues <Grade>(); var enumGradeList = new SelectList(enumGrade, "Value", "Text"); ViewData["Grade"] = enumGradeList; //var Numberitem = _comissionService.GetCommissionNumber(1); //ViewData["CommissionNumber"] = Numberitem.Item1; var gender = EnumerationService.GetEnumValues <Gender>(); var genderList = new SelectList(gender, "Value", "Text"); TempData["Gender"] = genderList; var enumMilitaryServiceStatus = EnumerationService.GetEnumValues <MilitaryServiceStatus>(); var enumMilitaryServiceStatusList = new SelectList(enumMilitaryServiceStatus, "Value", "Text"); ViewData["MilitaryServiceStatus"] = enumMilitaryServiceStatusList; // این اکد اشتباه می باشد زیرا ممکن است رشته ای برای کاربر در نظر گرفته نشده باشد // برای همین خطا خواهیم داشت و چه طوری باید مقادیر در // drowpfownmoel // قرار بگیرد var queryItemFieldofStudy = _structureManageService.GetAllFieldofStudy(userId, 1).Item3.AsEnumerable(); if (queryItemFieldofStudy != null) { var fieldofStudies = (from f in queryItemFieldofStudy select new DropDownModel { Value = f.Id.ToString(), Text = f.OrganizationStructureName.Name }).ToList(); var listFieldofStudy = new SelectList(fieldofStudies, "Value", "Text"); ViewData["FieldofStudy"] = listFieldofStudy; } else { ViewData["FieldofStudy"] = new List <DropDownModel>(); } var userAuthenticationType = (AuthenticationType)Enum.Parse(typeof(AuthenticationType), User.AuthenType(), true); // این متد در اینجا برداشته شده است و به فرم صدور رای منتقل شده است زیرا در صدور رای باید شماره کمیسیون زده شود ////var levelId = Convert.ToInt64(User.LevelId()); ////var commissionNumber = _comissionService.GetCommissionNumber(levelId); return(View(new CommissionModel { CommissionNumber = 0, Date = DateTime.Now })); }
public virtual ActionResult Create() { var userId = long.Parse(User.Identity.GetUserId()); var enumGrade = EnumerationService.GetEnumValues <Grade>(); var enumGradeList = new SelectList(enumGrade, "Value", "Text"); ViewData["Grade"] = enumGradeList; var enumMilitaryServiceStatus = EnumerationService.GetEnumValues <MilitaryServiceStatus>(); var enumMilitaryServiceStatusList = new SelectList(enumMilitaryServiceStatus, "Value", "Text"); ViewData["MilitaryServiceStatus"] = enumMilitaryServiceStatusList; var querysearch = _structureManageService.GetAllFieldofStudy(userId, 1).Item3.AsEnumerable(); if (querysearch != null) { var fieldofStudies = (from f in querysearch select new DropDownModel { Value = f.Id.ToString(), Text = f.OrganizationStructureName.Name }).ToList(); var listFieldofStudy = new SelectList(fieldofStudies, "Value", "Text"); ViewData["FieldofStudy"] = listFieldofStudy; } else { ViewData["FieldofStudy"] = new List <DropDownModel>(); } var gender = EnumerationService.GetEnumValues <Gender>(); var genderList = new SelectList(gender, "Value", "Text"); TempData["Gender"] = genderList; var userAuthenticationType = (AuthenticationType)Enum.Parse(typeof(AuthenticationType), User.AuthenType(), true); // این متد به کنترل صدور رای منتقل شده است // در فرم صدور رای نیاز به شماره کمیسیون می باشد ////var levelId = Convert.ToInt64(User.LevelId()); ////var councilNumber = _councilService.GetCouncilNumber(levelId); return(View(new CouncilModel { CouncilNumber = 0, Date = DateTime.Now })); }
[OutputCache(VaryByParam = "*", Duration = 0, NoStore = true)] // will be applied to all actions in MyController, unless those actions override with their own decoration public virtual ActionResult Index(long?personId) { try { if (string.IsNullOrWhiteSpace(personId.ToString())) { personId = long.Parse(User.Identity.GetUserId()); } var state = _personManagementService.GetProfileFullInfo(Convert.ToInt64(personId)); //string s=~/ Content / Images / Avatars / @Model.ModelProfile.Avatar; if (!state.Item1) { return(View(MVC.Errors.Views.Error)); } var grade = EnumerationService.GetEnumValues <Grade>(); var gradeList = new SelectList(grade, "Value", "Text"); TempData["Grade"] = gradeList; var gender = EnumerationService.GetEnumValues <Gender>(); var genderList = new SelectList(gender, "Value", "Text"); TempData["Gender"] = genderList; var militaryServiceStatus = EnumerationService.GetEnumValues <MilitaryServiceStatus>(); var militaryServiceStatusList = new SelectList(militaryServiceStatus, "Value", "Text"); TempData["MilitaryServiceStatus"] = militaryServiceStatusList; var fieldofStudies = (from f in _structureManageService.GetAllFieldofStudy().Item3.AsEnumerable() select new DropDownModel { Value = f.Id.ToString(), Text = f.OrganizationStructureName.Name }).ToList(); var listFieldofStudy = new SelectList(fieldofStudies, "Value", "Text"); TempData["FieldofStudy"] = listFieldofStudy; ViewBag.Cancelurl = Url.Action(MVC.Admin.Person.Index()); ViewBag.ActionUrlSavePassword = Url.Action(MVC.Admin.Profile.SavePassword(), "http"); return(View(state.Item3)); } catch (Exception) { return(View(MVC.Errors.Views.Error)); } }
public virtual ActionResult Update(long requestId) { var userId = long.Parse(User.Identity.GetUserId()); var commissionModel = _comissionService.FindInfoCommission(requestId); var enumGrade = EnumerationService.GetEnumValues <Grade>(); var enumGradeList = new SelectList(enumGrade, "Value", "Text"); TempData["Grade"] = enumGradeList; var enumMilitaryServiceStatus = EnumerationService.GetEnumValues <MilitaryServiceStatus>(); var enumMilitaryServiceStatusList = new SelectList(enumMilitaryServiceStatus, "Value", "Text"); TempData["MilitaryServiceStatus"] = enumMilitaryServiceStatusList; var gender = EnumerationService.GetEnumValues <Gender>(); var genderList = new SelectList(gender, "Value", "Text"); TempData["Gender"] = genderList; var querysearch = _structureManageService.GetAllFieldofStudy(userId, 1).Item3.AsEnumerable(); if (querysearch != null) { var fieldofStudies = (from f in querysearch select new DropDownModel { Value = f.Id.ToString(), Text = f.OrganizationStructureName.Name }).ToList(); var listFieldofStudy = new SelectList(fieldofStudies, "Value", "Text"); TempData["FieldofStudy"] = listFieldofStudy; } else { TempData["FieldofStudy"] = new List <DropDownModel>(); } return(View(commissionModel.Item3)); }
public virtual ActionResult GetStudentProfile(long studentNumber, int requestType) { var userId = long.Parse(User.Identity.GetUserId()); var studentProfile = _personManagementService.GetStudentProfile(studentNumber, userId); var enumGrade = EnumerationService.GetEnumValues <Grade>(); var enumGradeList = new SelectList(enumGrade, "Value", "Text"); TempData["Grade"] = enumGradeList; var enumMilitaryServiceStatus = EnumerationService.GetEnumValues <MilitaryServiceStatus>(); var enumMilitaryServiceStatusList = new SelectList(enumMilitaryServiceStatus, "Value", "Text"); TempData["MilitaryServiceStatus"] = enumMilitaryServiceStatusList; var gender = EnumerationService.GetEnumValues <Gender>(); var genderList = new SelectList(gender, "Value", "Text"); TempData["Gender"] = genderList; var query = _structureManageService.GetAllFieldofStudy(userId, 1).Item3.AsEnumerable(); if (query != null) { var fieldofStudies = (from f in query select new DropDownModel { Value = f.Id.ToString(), Text = f.OrganizationStructureName.Name }).ToList(); var listFieldofStudy = new SelectList(fieldofStudies, "Value", "Text"); TempData["FieldofStudy"] = listFieldofStudy; } else { TempData["FieldofStudy"] = new List <DropDownModel>(); } return(PartialView(MVC.Personel.Commission.Views._StudentProfile, studentProfile.Item3)); }