public SelectList getTransactionMasters(string frequency = null) { List <TransactionMasterDTO> lstentitleDto = _ddlRepo.GetTransactionMasters(frequency); TransactionMasterDTO trMasterDTO = new TransactionMasterDTO(); trMasterDTO.TranMasterId = -1; trMasterDTO.TransactionName = string.Empty; lstentitleDto.Insert(0, trMasterDTO); return(new SelectList(lstentitleDto, "TranMasterId", "TransactionName")); }
public ActionResult TransactionRule(string mode, int?id) { Helpers.UIDropDownRepo uiDDLRepo = new Helpers.UIDropDownRepo(_ddlRepo); TransactionRuleVM trRuleVM = new TransactionRuleVM(); trRuleVM.IsPostBack = "FALSE"; if (string.Equals(mode, "EDIT", StringComparison.OrdinalIgnoreCase)) { StatusDTO <TransactionRuleDTO> trRule = _trRule.Select(id.Value); if (trRule != null) { trRuleVM.Active = trRule.ReturnObj.Active; trRuleVM.ActualAmount = trRule.ReturnObj.ActualAmount; trRuleVM.ClassType = trRule.ReturnObj.ClassType; trRuleVM.DueDateIncreasesBy = trRule.ReturnObj.DueDateIncreasesBy; trRuleVM.FirstDueAfterDays = trRule.ReturnObj.FirstDueAfterDays; trRuleVM.IsdifferentTo = trRule.ReturnObj.IsdifferentTo; trRuleVM.PenaltyAmount = trRule.ReturnObj.PenaltyAmount; trRuleVM.PenaltyCalculatedIn = trRule.ReturnObj.PenaltyCalculatedIn; trRuleVM.PenaltyTransactionRule = trRule.ReturnObj.PenaltyTransactionRule; trRuleVM.PenaltyTransactionType = trRule.ReturnObj.PenaltyTransactionType; trRuleVM.RuleName = trRule.ReturnObj.RuleName; trRuleVM.Section = trRule.ReturnObj.Section; trRuleVM.Standard = trRule.ReturnObj.Standard; trRuleVM.TranMaster = trRule.ReturnObj.TranMaster; trRuleVM.TranRuleId = trRule.ReturnObj.TranRuleId; trRuleVM.UserDTO = trRule.ReturnObj.UserDTO; trRuleVM.MODE = "EDIT"; if (trRuleVM.TranMaster != null) { trRuleVM.SelectedFrequency = _trnsMaster.GetFreq(trRuleVM.TranMaster.TranMasterId); } trRuleVM.TransactionMasters = uiDDLRepo.getTransactionMasters(trRuleVM.SelectedFrequency); } else { trRuleVM.TransactionMasters = new SelectList(new List <TransactionMasterDTO>(), "TranMasterId", "TransactionName"); if (TempData.Peek("RuleSearchCriteria") != null) { trRuleVM = (TransactionRuleVM)TempData.Peek("RuleSearchCriteria"); trRuleVM.TransactionMasters = new SelectList(_ddlRepo.GetTransactionMasters(trRuleVM.SelectedFrequency), "TranMasterId", "TransactionName"); trRuleVM.IsPostBack = "TRUE"; } trRuleVM.MODE = "ADD"; trRuleVM.Active = true; } } else { trRuleVM.TransactionMasters = new SelectList(new List <TransactionMasterDTO>(), "TranMasterId", "TransactionName"); if (TempData.Peek("RuleSearchCriteria") != null) { trRuleVM = (TransactionRuleVM)TempData.Peek("RuleSearchCriteria"); trRuleVM.TransactionMasters = new SelectList(_ddlRepo.GetTransactionMasters(trRuleVM.SelectedFrequency), "TranMasterId", "TransactionName"); trRuleVM.IsPostBack = "TRUE"; } trRuleVM.MODE = "ADD"; trRuleVM.Active = true; } trRuleVM.TransactionFrequencies = uiDDLRepo.getTransactionFrequencies(); trRuleVM.Users = uiDDLRepo.getUserDropDown(); trRuleVM.Standards = uiDDLRepo.getStandardDropDown(); trRuleVM.Sections = uiDDLRepo.getSectionDropDown(); trRuleVM.PenaltyCalcIn = uiDDLRepo.getCalcType(); trRuleVM.ClassTypes = uiDDLRepo.getClassTypeDropDown(); trRuleVM.PenaltyTransactionTypes = uiDDLRepo.getTransactionTypes(); trRuleVM.PenaltyTransactionRules = uiDDLRepo.getTransactionRules(); trRuleVM.ErrorMsg = string.Empty; trRuleVM.SuccessMsg = string.Empty; return(View(trRuleVM)); }
public JsonResult GetTransactionMasterDDL() { return(Json(_dropDwnRepo.GetTransactionMasters(), JsonRequestBehavior.AllowGet)); }