public ActionResult SearchRules(TransactionRuleVM tranRule)
        {
            string validMsg = string.Empty;

            Helpers.UIDropDownRepo uiDDLRepo = new Helpers.UIDropDownRepo(_ddlRepo);
            tranRule.IsPostBack = "TRUE";
            if (ValidateSearch(tranRule, out validMsg))
            {
                //Need to change as it will also store the search result and the memory usage will be high
                TempData["RuleSearchCriteria"] = tranRule;

                tranRule.SearchedResult = new List <TransactionRuleVM>();

                this.AddSearchResult(ref tranRule);
                //tranRule.IsPostBack = "TRUE";
            }
            else
            {
                tranRule.ErrorMsg = validMsg;
            }

            tranRule.TransactionFrequencies = uiDDLRepo.getTransactionFrequencies();
            tranRule.Users              = uiDDLRepo.getUserDropDown();
            tranRule.Standards          = uiDDLRepo.getStandardDropDown();
            tranRule.Sections           = uiDDLRepo.getSectionDropDown();
            tranRule.ClassTypes         = uiDDLRepo.getClassTypeDropDown();
            tranRule.TransactionMasters = new SelectList(_ddlRepo.GetTransactionMasters(tranRule.SelectedFrequency), "TranMasterId", "TransactionName");

            return(View(tranRule));
        }
        public ActionResult SearchRules()
        {
            Helpers.UIDropDownRepo uiDDLRepo = new Helpers.UIDropDownRepo(_ddlRepo);

            TransactionRuleVM tranRule = new TransactionRuleVM();

            tranRule.TransactionMasters = new SelectList(new List <TransactionMasterDTO>(), "TranMasterId", "TransactionName");

            tranRule.IsPostBack = "FALSE";

            if (TempData.Peek("RuleSearchCriteria") != null)
            {
                tranRule = (TransactionRuleVM)TempData.Peek("RuleSearchCriteria");
                this.AddSearchResult(ref tranRule);
                tranRule.TransactionMasters = new SelectList(_ddlRepo.GetTransactionMasters(tranRule.SelectedFrequency), "TranMasterId", "TransactionName");

                tranRule.IsPostBack = "TRUE";
            }
            else
            {
                tranRule.SearchedResult = new List <TransactionRuleVM>();
            }

            tranRule.TransactionFrequencies = uiDDLRepo.getTransactionFrequencies();
            tranRule.Users      = uiDDLRepo.getUserDropDown();
            tranRule.Standards  = uiDDLRepo.getStandardDropDown();
            tranRule.Sections   = uiDDLRepo.getSectionDropDown();
            tranRule.ClassTypes = uiDDLRepo.getClassTypeDropDown();



            tranRule.SuccessMsg = "";
            tranRule.ErrorMsg   = "";
            return(View(tranRule));
        }
        public ActionResult TransactionRule(TransactionRuleVM trRuleVM)
        {
            Helpers.UIDropDownRepo uiDDLRepo = new Helpers.UIDropDownRepo(_ddlRepo);
            string message = string.Empty;
            string diffTo  = string.Empty;

            if (Validate(trRuleVM, out message, out diffTo))
            {
                //string diffTo = _trnsMaster.GetIsDifferentTo(trRuleVM.TranMaster.TranMasterId);

                if (!_trRule.IsDuplicate(trRuleVM.TranMaster.TranMasterId, trRuleVM.Standard == null?-1: trRuleVM.Standard.StandardId, trRuleVM.Section == null?-1: trRuleVM.Section.SectionId, trRuleVM.ClassType == null?-1: trRuleVM.ClassType.ClassTypeId, trRuleVM.UserDTO == null?-1: trRuleVM.UserDTO.UserMasterId, diffTo, trRuleVM.MODE, trRuleVM.TranRuleId))
                {
                    if (string.Equals(trRuleVM.MODE, "EDIT"))
                    {
                        _trRule.Update(trRuleVM);
                        return(RedirectToAction("SearchRules"));
                    }
                    _trRule.Insert(trRuleVM);
                    ModelState.Clear();

                    trRuleVM.MODE   = "ADD";
                    trRuleVM.Active = true;

                    trRuleVM.SuccessMsg = "Rule added successfully.";
                    trRuleVM.ErrorMsg   = string.Empty;
                }
                else
                {
                    trRuleVM.ErrorMsg   = "Rule is not unique for this transaction name.";
                    trRuleVM.SuccessMsg = string.Empty;
                }
            }
            else
            {
                trRuleVM.ErrorMsg   = message;
                trRuleVM.SuccessMsg = string.Empty;
            }
            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.TransactionMasters      = uiDDLRepo.getTransactionMasters();
            trRuleVM.PenaltyTransactionRules = uiDDLRepo.getTransactionRules();
            trRuleVM.IsPostBack              = "TRUE";


            return(RedirectToAction("SearchRules"));
        }
        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));
        }
예제 #5
0
        public ActionResult Register(string mode, string id)
        {
            Models.UserViewModel uvModel = new Models.UserViewModel();
            uvModel.MODE          = mode;
            uvModel.DisabledClass = string.Empty;
            if (string.Equals(mode, "EDIT", StringComparison.OrdinalIgnoreCase) || string.Equals(mode, "VIEW", StringComparison.OrdinalIgnoreCase))
            {
                uvModel.UserMasterId = int.Parse(id);
            }
            if (string.Equals(mode, "VIEW", StringComparison.OrdinalIgnoreCase))
            {
                uvModel.DisabledClass = "disabledPlace";
            }
            if (mode != null && string.Equals(mode, "EDIT", StringComparison.OrdinalIgnoreCase) || string.Equals(mode, "VIEW", StringComparison.OrdinalIgnoreCase))
            {
                //Populate edit data using id passed in URL, if id==null then show error message
                StatusDTO <UserMasterDTO> dto = _userSvc.Select(Convert.ToInt32(id));
                uvModel.UserMasterId = dto.ReturnObj.UserMasterId;
                //uvModel.UserMasterId = dto.ReturnObj.UserMasterId;
                uvModel.FName                 = dto.ReturnObj.FName;
                uvModel.MName                 = dto.ReturnObj.MName;
                uvModel.LName                 = dto.ReturnObj.LName;
                uvModel.Gender                = dto.ReturnObj.Gender;
                uvModel.Image                 = dto.ReturnObj.Image;
                uvModel.DOB                   = dto.ReturnObj.DOB;
                uvModel.DOBString             = uvModel.DOB.HasValue ? uvModel.DOB.Value.ToString("dd-MMM-yyyy") : string.Empty;
                uvModel.EmailId               = dto.ReturnObj.EmailId;
                uvModel.ResidentialAddress    = dto.ReturnObj.ResidentialAddress;
                uvModel.PermanentAddress      = dto.ReturnObj.PermanentAddress;
                uvModel.ContactNo             = dto.ReturnObj.ContactNo;
                uvModel.AltContactNo          = dto.ReturnObj.AltContactNo;
                uvModel.BloodGroup            = dto.ReturnObj.BloodGroup;
                uvModel.Location              = dto.ReturnObj.Location;
                uvModel.Role                  = dto.ReturnObj.Role;
                uvModel.UserEntitlementList   = _userSvc.GetUserEntitlement(dto.ReturnObj.UserMasterId);
                uvModel.SelectUserEntitlement = _ddlRepo.GetUserRole();
                uvModel.Subject               = _ddlRepo.Subject();

                uvModel.Employee = new EmployeeDetailsDTO();
                if (dto.ReturnObj.Employee != null)
                {
                    uvModel.Employee.EmployeeId = dto.ReturnObj.Employee.EmployeeId;
                    uvModel.hdnEmployeeId       = dto.ReturnObj.Employee.EmployeeId;
                    uvModel.Employee.EducationalQualification = dto.ReturnObj.Employee.EducationalQualification;
                    uvModel.Employee.DateOfJoining            = dto.ReturnObj.Employee.DateOfJoining;

                    uvModel.DOJString = uvModel.Employee.DateOfJoining.HasValue ? uvModel.Employee.DateOfJoining.Value.ToString("dd-MMM-yyyy") : string.Empty;

                    uvModel.Employee.StaffEmployeeId = dto.ReturnObj.Employee.StaffEmployeeId;
                    uvModel.Employee.Department      = dto.ReturnObj.Employee.Department;
                    uvModel.Employee.Designation     = dto.ReturnObj.Employee.Designation;

                    uvModel.FacultyCourseList = _userSvc.GetFacultyCourseMap(dto.ReturnObj.Employee.EmployeeId);
                    if (dto.ReturnObj.Employee.ClassType != null)
                    {
                        uvModel.Employee.ClassType = dto.ReturnObj.Employee.ClassType;
                    }

                    string employeeImageFolder = _configSvc.GetEmployeeImagesFolder();

                    uvModel.employeeimagepath = _configSvc.GetEmployeeImagesRelPath() + "/" + GetImageFileName(uvModel.Employee.StaffEmployeeId, employeeImageFolder);
                    //if(dto.ReturnObj.Employee.ClassType != null)
                    //{
                    //    uvModel.Employee.Subject = dto.ReturnObj.Employee.Subject;
                    //}
                }
            }

            uvModel.GenderList            = _uiddlRepo.getGenderDropDown();
            uvModel.LocationList          = _uiddlRepo.getLocationDropDown();
            uvModel.RoleList              = _uiddlRepo.getRoleDropDown();
            uvModel.DepartmentList        = _uiddlRepo.getDepartmentDropDown();
            uvModel.DesignationList       = _uiddlRepo.getDesignationDropDown();
            uvModel.SelectUserEntitlement = _ddlRepo.GetUserRole();
            uvModel.ClassTypeList         = _uiddlRepo.getClassTypeDropDown();
            //uvModel.SubjectList = _uiddlRepo.getSubjectDropDown();

            return(View(uvModel));
        }
예제 #6
0
        public ActionResult Register(string mode, string id)
        {
            Models.StudentVM studView = new Models.StudentVM();
            studView.UserDetails   = new UserMasterDTO();
            studView.MODE          = mode;
            studView.DisabledClass = "";
            if (string.Equals(mode, "EDIT", StringComparison.OrdinalIgnoreCase))
            {
                studView.UserDetails.UserMasterId = int.Parse(id);
            }
            if (string.Equals(mode, "VIEW", StringComparison.OrdinalIgnoreCase))
            {
                studView.DisabledClass = "disabledPlace";
            }
            studView.Transactions = new List <UserTransactionDTO>();
            if (mode != null && (string.Equals(mode, "EDIT", StringComparison.OrdinalIgnoreCase) || string.Equals(mode, "VIEW", StringComparison.OrdinalIgnoreCase)))
            {
                //Populate edit data using id passed in URL, if id==null then show error message
                StatusDTO <StudentDTO> dto = _studSvc.Select(Convert.ToInt32(id));
                studView.UserDetails = new UserMasterDTO();
                studView.UserDetails.UserMasterId = dto.ReturnObj.UserDetails.UserMasterId;
                //uvModel.UserMasterId = dto.ReturnObj.UserMasterId;
                studView.UserDetails.FName              = dto.ReturnObj.UserDetails.FName;
                studView.UserDetails.MName              = dto.ReturnObj.UserDetails.MName;
                studView.UserDetails.LName              = dto.ReturnObj.UserDetails.LName;
                studView.UserDetails.Gender             = dto.ReturnObj.UserDetails.Gender;
                studView.UserDetails.Image              = dto.ReturnObj.UserDetails.Image;
                studView.UserDetails.DOB                = dto.ReturnObj.UserDetails.DOB;
                studView.DOBString                      = studView.UserDetails.DOB.HasValue ? studView.UserDetails.DOB.Value.ToString("dd-MMM-yyyy") : string.Empty;
                studView.UserDetails.EmailId            = dto.ReturnObj.UserDetails.EmailId;
                studView.UserDetails.ResidentialAddress = dto.ReturnObj.UserDetails.ResidentialAddress;
                studView.UserDetails.PermanentAddress   = dto.ReturnObj.UserDetails.PermanentAddress;
                studView.UserDetails.ContactNo          = dto.ReturnObj.UserDetails.ContactNo;
                studView.UserDetails.AltContactNo       = dto.ReturnObj.UserDetails.AltContactNo;
                studView.UserDetails.BloodGroup         = dto.ReturnObj.UserDetails.BloodGroup;
                studView.UserDetails.Location           = dto.ReturnObj.UserDetails.Location;
                studView.UserDetails.Role               = dto.ReturnObj.UserDetails.Role;

                //studView.Student = new StudentDTO();
                studView.RollNumber             = dto.ReturnObj.RollNumber;
                studView.RegistrationNumber     = dto.ReturnObj.RegistrationNumber;
                studView.AdmissionDate          = dto.ReturnObj.AdmissionDate;
                studView.FatherContact          = dto.ReturnObj.FatherContact;
                studView.GuardianName           = dto.ReturnObj.GuardianName;
                studView.FatherEmailId          = dto.ReturnObj.FatherEmailId;
                studView.HouseType              = dto.ReturnObj.HouseType;
                studView.StandardSectionMap     = dto.ReturnObj.StandardSectionMap;
                studView.FatherName             = dto.ReturnObj.FatherName;
                studView.FatherQualification    = dto.ReturnObj.FatherQualification;
                studView.FatherOccupation       = dto.ReturnObj.FatherOccupation;
                studView.FatherDesignation      = dto.ReturnObj.FatherDesignation;
                studView.FatherOrganisationName = dto.ReturnObj.FatherOrganisationName;
                studView.MotherName             = dto.ReturnObj.MotherName;
                studView.MotherQualification    = dto.ReturnObj.MotherQualification;
                studView.MotherOccupation       = dto.ReturnObj.MotherOccupation;
                studView.MotherAnnualIncome     = dto.ReturnObj.MotherAnnualIncome;
                studView.MotherOrganisationName = dto.ReturnObj.MotherOrganisationName;
                studView.IsChristian            = dto.ReturnObj.IsChristian;
                studView.IsParentTeacher        = dto.ReturnObj.IsParentTeacher;
                studView.SubjectNameTheyTeach   = dto.ReturnObj.SubjectNameTheyTeach;
                studView.IsParentFromEngMedium  = dto.ReturnObj.IsParentFromEngMedium;
                studView.IsJointOrNuclearFamily = dto.ReturnObj.IsJointOrNuclearFamily;
                studView.SiblingsInStadOrNot    = dto.ReturnObj.SiblingsInStadOrNot;
                studView.AnyAlumuniMember       = dto.ReturnObj.AnyAlumuniMember;
                studView.StuInPrivateTution     = dto.ReturnObj.StuInPrivateTution;
                studView.NoOfTution             = dto.ReturnObj.NoOfTution;
                studView.FeesPaidForTution      = dto.ReturnObj.FeesPaidForTution;

                studView.Transactions       = _userTrans.GetUserTransactions(dto.ReturnObj.UserDetails.UserMasterId);
                studView.TransactionMasters = _uiddlRepo.getTransactionMasters();


                string studentImageFolder = _configSvc.GetStudentImagesFolder();
                string fatherImageFolder  = _configSvc.GetFatherImagesFolder();
                string motherImageFolder  = _configSvc.GetMotherImagesFolder();

                studView.StudentImagePath = _configSvc.GetStudentImagesRelPath() + "/" + GetImageFileName(studView.RegistrationNumber, studentImageFolder);
                studView.FatherImagePath  = _configSvc.GetFatherImagesRelPath() + "/" + GetImageFileName(studView.RegistrationNumber, fatherImageFolder);
                studView.MotherImagePath  = _configSvc.GetMotherImagesRelPath() + "/" + GetImageFileName(studView.RegistrationNumber, motherImageFolder);
            }

            //studView.Transactions = _userTrans.GetUserTransactions(dto.ReturnObj.UserDetails.UserMasterId);
            studView.TransactionMasters = _uiddlRepo.getTransactionMasters();

            studView.CalcInSelectList            = _uiddlRepo.getCalcTypeDic();
            studView.TransactionMasterSelectList = _dropDwnRepo.GetTransactionMasters();

            studView.GenderList               = _uiddlRepo.getGenderDropDown();
            studView.LocationList             = _uiddlRepo.getLocationDropDown();
            studView.RoleList                 = _uiddlRepo.getRoleDropDown();
            studView.ClassTypeList            = _uiddlRepo.getClassTypeDropDown();
            studView.SectionList              = _uiddlRepo.getSectionDropDown();
            studView.HouseList                = _uiddlRepo.getHouseDropDown();
            studView.IsChristianList          = _uiddlRepo.getSelectValueDropDown();
            studView.IsParentTeacherList      = _uiddlRepo.getSelectValueDropDown();
            studView.IsParentFromEngMedList   = _uiddlRepo.getSelectValueDropDown();
            studView.JointOrNuclearFamilyList = _uiddlRepo.getSelectJointNuclearDropDown();
            studView.SiblingsInStdOrNotList   = _uiddlRepo.getSelectValueDropDown();
            studView.AnyAlumunimemberList     = _uiddlRepo.getSelectValueDropDown();
            studView.StudentinPvtTutionList   = _uiddlRepo.getSelectValueDropDown();

            //uvModel.BookCategoryList = _uiddlRepo.getBookCategoryDropDown();
            //uvModel.DepartmentList = _uiddlRepo.getDepartmentDropDown();
            //uvModel.DesignationList = _uiddlRepo.getDesignationDropDown();
            studView.StandardSectionList = _uiddlRepo.getStandardSectionDropDown();
            studView.GraceAmountOnList   = _uiddlRepo.getCalcType();



            return(View(studView));
        }