public JsonResult SaveFeeCollectionAndPayment(FeePaymentDetailViewModel Model)
        {
            int UserId = Session["UserId"] != null?Convert.ToInt32(Session["UserId"]) : 0;

            Model.EnteredBy      = UserId;
            Model.EnteredDate    = (!string.IsNullOrEmpty(Model.SettleDate) ? DateTime.ParseExact(Model.SettleDate, "dd/MM/yyyy", CultureInfo.InvariantCulture) : DateTime.Now);
            TempData["errorMsg"] = "Fee successfully submitted.";
            LogActivityViewModel log = new LogActivityViewModel();

            log.EnteredBy       = Convert.ToInt32(Session["UserId"]);
            log.EnteredDate     = DateTime.Now;
            log.ActioName       = "SaveFeeCollectionAndPayment";
            log.ModuleName      = "FeeCollection";
            log.ControllerName  = "FeeManagement";
            log.Activity        = "Taking Fee";
            log.ActivityMessage = "Fee paid successfully for registration no " + Model.FeeDetail.RegistrationNo + "";
            log.RegistrationNo  = Model.FeeDetail.RegistrationNo;
            LogActivityService logActivityService = new LogActivityService();

            logActivityService.CreateLogActivity(log);
            if (Model.hdnFeeDetailId > 0)
            {
                return(Json(feeManegementService.SaveFeeCollectionAndPartWisePayment(Model), JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(feeManegementService.SaveFeeCollectionAndPayment(Model), JsonRequestBehavior.AllowGet));
            }
        }
        public ActionResult SaveCourseChange(int CourseId, int SessionYr, int RegNo, int FeeDetailId, string OldCourse, string Remark)
        {
            int UserId = Session["UserId"] != null?Convert.ToInt32(Session["UserId"]) : 0;

            string ChangeCourseWith  = feeManegementService.GetCourseNameByCourseId(CourseId);
            LogActivityViewModel log = new LogActivityViewModel();

            log.EnteredBy       = UserId;
            log.EnteredDate     = DateTime.Now;
            log.ActioName       = "SaveCourseChange";
            log.ModuleName      = "FeeCollection";
            log.ControllerName  = "FeeManagement";
            log.Activity        = "Change Course";
            log.ActivityMessage = "Course changed from " + OldCourse + " to " + ChangeCourseWith + " regarded registration No. " + RegNo;
            log.RegistrationNo  = RegNo;
            LogActivityService logActivityService = new LogActivityService();

            logActivityService.CreateLogActivity(log);
            string msg = feeManegementService.SaveCourseChange(CourseId, SessionYr, RegNo, UserId, FeeDetailId, OldCourse, Remark);

            if (msg != "")
            {
                TempData["errorMsg"] = msg;
            }
            else
            {
                TempData["errorMsg"] = "Inner exception error!";
            }
            return(Json(msg, JsonRequestBehavior.AllowGet));
        }
        public ActionResult UpdateMedicalRemark(int RegNo, string Remark, string MdlStatus, int Id, string tag = null)
        {
            int UserId = Convert.ToInt32(Session["UserId"]);
            var Result = registerService.UpdateMedicalRemark(RegNo, Remark, MdlStatus, Id, UserId, tag);

            Models.Common cm = new Models.Common();
            //  cm.GetResult(Result.Email, Convert.ToInt64(Result.ApplicationNo), "Selected", "Rejected");
            LogActivityViewModel log = new LogActivityViewModel();

            log.EnteredBy      = UserId;
            log.EnteredDate    = DateTime.Now;
            log.ActioName      = "UpdateMedicalRemark";
            log.ControllerName = "Registration";
            log.RegistrationNo = RegNo;
            if (string.IsNullOrEmpty(Result.Message))
            {
                log.ModuleName      = "Medical";
                log.Activity        = "Medical Rejected";
                log.ActivityMessage = "Medical clearance of registraion no " + RegNo + " is not cleared.";
            }
            else
            {
                log.ModuleName      = "Withdrawal";
                log.Activity        = "Create Withdrawal";
                log.ActivityMessage = Result.Message;
            }
            logActivityService.CreateLogActivity(log);
            return(Json(Result.MStatus, JsonRequestBehavior.AllowGet));
        }
        public ActionResult Create(RegistrationViewModel model)
        {
            //if ((!string.IsNullOrEmpty(model.page) && model.page == "ReRegister") || registerService.IsManualExistByEmail(model.Email, model.Mobile))
            //{
            //    registerService.DisableReregisterOldRecord(model.Email, model.Mobile);
            //    model.Id = 0;
            //}
            LogActivityViewModel log = new LogActivityViewModel();

            log.EnteredBy      = Convert.ToInt32(Session["UserId"]);
            log.EnteredDate    = DateTime.Now;
            log.ActioName      = "Create";
            log.ModuleName     = "Registration";
            log.ControllerName = "Registration";
            log.RegistrationNo = model.RegistartionNo;
            model = registerService.AddUpdate(model);
            if (model.Id == 0)
            {
                TempData["msg"]     = "Created Successfully!";
                log.Activity        = "Create";
                log.ActivityMessage = "New candidate registraion no " + model.RegistartionNo + " is created.";
            }
            else
            {
                TempData["msg"]     = "Updated Successfully!";
                log.Activity        = "Update";
                log.ActivityMessage = "Candidate registration no " + model.RegistartionNo + " details are updated.";
            }
            logActivityService.CreateLogActivity(log);
            return(RedirectToAction(""));
            //if (!model.IsConsultantCandidate)
            //    return Redirect(Url.Action("Create", "Registration") + "?Id=" + model.Id);
            //else
            //    return RedirectToAction("");
        }
        public JsonResult ScreeningTestSubmit(ScreeningInfoViewModel Model)
        {
            Models.Common cm = new Models.Common();
            Model.CreatedBy = Convert.ToInt32(Session["UserId"]);
            var Obj = registerService.ScreeningTestSubmit(Model);

            if (Obj.MStatus && Obj.IsSelected.HasValue && !Obj.IsSelected.Value && !Model.IsStandBy)
            {
                string currentTime = DateTime.Now.ToShortTimeString();
                string dt          = Model.CreatedDate + " " + currentTime;
                SendingEmailForRejectedCandidateViewModel objSend = new SendingEmailForRejectedCandidateViewModel
                {
                    DateOfSending  = DateTime.ParseExact(dt, "dd/MM/yyyy HH:mm", CultureInfo.InvariantCulture),
                    Email          = Obj.Email,
                    IsActive       = true,
                    IsSendEmail    = false,
                    RegistrationNo = Obj.RegistrationId
                };
                registerService.SaveSendRejectedEmailInfo(objSend);
                //cm.GetResult(Model.Email, Convert.ToInt64(Model.ApplicationNo), "Rejected", "Pending");
                //  Email.SendEmailWithSingleTemplate(Obj.Email, "Spice Star - Candidate Rejected", "~/Templates/RejectedEmailTemplate.html");
            }
            string msg = "";

            if (Obj.MStatus)
            {
                LogActivityViewModel log = new LogActivityViewModel();
                log.EnteredBy      = Convert.ToInt32(Session["UserId"]);
                log.EnteredDate    = DateTime.Now;
                log.ActioName      = "ScreeningTestSubmit";
                log.ModuleName     = "Screenning";
                log.ControllerName = "Registration";
                log.RegistrationNo = Model.RegistrationId;
                if (Model.IsSelected.HasValue && !Model.IsSelected.Value)
                {
                    if (Model.IsStandBy)
                    {
                        msg                 = "Screening Test (RegNo: " + Model.RegistrationId + ") is on Stand-By!";
                        log.Activity        = "Screenning on stand by";
                        log.ActivityMessage = "Screening test of registration no " + Model.RegistrationId + " is on Stand-By!";
                        logActivityService.CreateLogActivity(log);
                    }
                    else
                    {
                        msg                 = "Screening Test (RegNo: " + Model.RegistrationId + ")  is rejected!";
                        log.Activity        = "Screenning as rejected";
                        log.ActivityMessage = "Screening test of registration no " + Model.RegistrationId + " is rejected!";
                        logActivityService.CreateLogActivity(log);
                    }
                }
                else if (Model.IsSelected.HasValue && Model.IsSelected.Value)
                {
                    msg                 = "Screening Test cleared successfully and your Admission Number is: " + Model.RegistrationId + "";
                    log.Activity        = "Screenning cleared";
                    log.ActivityMessage = "Screening test of registration no " + Model.RegistrationId + " is cleared successfully.";
                    logActivityService.CreateLogActivity(log);
                }
            }
            return(Json(msg, JsonRequestBehavior.AllowGet));
        }
        public ActionResult UpdateAdmissionBasicDatail(AddmissionMasterViewModel model, HttpPostedFileBase imageFile)
        {
            if (imageFile != null)
            {
                var    ext      = Path.GetExtension(imageFile.FileName);
                string fname    = "Resume-" + model.Id + ext;
                string Newfname = Path.Combine(Server.MapPath("~/Resumes/"), fname);
                addmissionService.UpdateResumePath(model.Id, "/Resumes/" + fname);
                imageFile.SaveAs(Newfname);
            }
            var userId = Convert.ToInt32(Session["UserId"]);

            model.UpdatedBy = userId;
            var status = addmissionService.UpdateAdmissionBasicDetail(model);
            LogActivityViewModel log = new LogActivityViewModel();

            log.EnteredBy       = Convert.ToInt32(Session["UserId"]);
            log.EnteredDate     = DateTime.Now;
            log.ActioName       = "UpdateAdmissionBasicDatail";
            log.ModuleName      = "Admission";
            log.ControllerName  = "Addmission";
            log.Activity        = "Update Basic Detail";
            log.ActivityMessage = "Admission basic detail of registraion no " + model.RegNo + " updated.";
            log.RegistrationNo  = model.RegNo;
            logActivityService.CreateLogActivity(log);
            return(Json(status, JsonRequestBehavior.AllowGet));
        }
        public ActionResult UpdateMedicalDetail(MedicalDetailViewModel model)
        {
            bool status = addmissionService.UpdateMedicalDetail(model);
            LogActivityViewModel log = new LogActivityViewModel();

            log.EnteredBy       = Convert.ToInt32(Session["UserId"]);
            log.EnteredDate     = DateTime.Now;
            log.ActioName       = "UpdateMedicalDetail";
            log.ModuleName      = "Admission";
            log.ControllerName  = "Addmission";
            log.Activity        = "Update Medical Detail";
            log.ActivityMessage = "Admission medical detail of registraion no " + model.RegNo + " updated.";
            log.RegistrationNo  = Convert.ToInt32(model.RegNo);
            logActivityService.CreateLogActivity(log);
            return(Json(status, JsonRequestBehavior.AllowGet));
        }
        public LogActivityViewModel CreateLogActivity(LogActivityViewModel Model)
        {
            UserActivityLog log = new UserActivityLog
            {
                ActioName       = Model.ActioName,
                Activity        = Model.Activity,
                ActivityMessage = Model.ActivityMessage,
                ControllerName  = Model.ControllerName,
                EnteredBy       = Model.EnteredBy,
                EnteredDate     = Model.EnteredDate,
                ModuleName      = Model.ModuleName,
                RegistrationNo  = Model.RegistrationNo
            };

            _context.UserActivityLogs.Add(log);
            _context.SaveChanges();
            return(Model);
        }
Exemplo n.º 9
0
        public string AddUpdateBatchMaster(RoleViewModel Model)
        {
            try
            {
                string      status = "";
                BatchMaster role   = null;

                LogActivityViewModel log = new LogActivityViewModel();
                log.EnteredBy      = Model.EnteredBy;
                log.EnteredDate    = DateTime.Now;
                log.ActioName      = "AddUpdateBatchMaster";
                log.ModuleName     = "Control Panel";
                log.ControllerName = "Admin";
                if (Model.Id > 0)
                {
                    role                = _context.BatchMasters.Where(b => b.Id == Model.Id).FirstOrDefault();
                    status              = "Update Successfully!";
                    log.Activity        = "Update";
                    log.ActivityMessage = "'" + Model.Name + "' is updated.";
                }
                if (role == null)
                {
                    role = new BatchMaster();
                }
                role.IsActive    = Model.IsActive;
                role.Name        = Model.Name;
                role.DateOfStart = !string.IsNullOrEmpty(Model.BatchStartDateStr) ? (DateTime.ParseExact(Model.BatchStartDateStr, "dd/MM/yyyy", CultureInfo.InvariantCulture)) : (DateTime?)null;
                role.DateOfEnd   = !string.IsNullOrEmpty(Model.BatchEndDateStr) ? (DateTime.ParseExact(Model.BatchEndDateStr, "dd/MM/yyyy", CultureInfo.InvariantCulture)) : (DateTime?)null;
                if (Model.Id == 0)
                {
                    status              = "Add Successfully!";
                    log.Activity        = "Create";
                    log.ActivityMessage = "'" + Model.Name + "' is added.";
                    _context.BatchMasters.Add(role);
                }
                _context.SaveChanges();
                logActivityService.CreateLogActivity(log);
                return(status);
            }
            catch (Exception ex)
            {
                return(ex.Message);
            }
        }
        public ActionResult SaveCourseChange(int CourseId, int SessionYr, int RegNo, string OldCourse)
        {
            FeeManagementService _feeService = new FeeManagementService();
            int UserId = Session["UserId"] != null?Convert.ToInt32(Session["UserId"]) : 0;

            string ChangeCourseWith  = _feeService.GetCourseNameByCourseId(CourseId);
            LogActivityViewModel log = new LogActivityViewModel();

            log.EnteredBy       = UserId;
            log.EnteredDate     = DateTime.Now;
            log.ActioName       = "SaveCourseChange";
            log.ModuleName      = "Screenning";
            log.ControllerName  = "Registration";
            log.Activity        = "Change Course";
            log.ActivityMessage = "Course changed from " + OldCourse + " to " + ChangeCourseWith + " regarded registration No. " + RegNo;
            log.RegistrationNo  = RegNo;
            LogActivityService logActivityService = new LogActivityService();

            logActivityService.CreateLogActivity(log);
            return(Json(_feeService.SaveCourseChange(CourseId, SessionYr, RegNo, UserId, 0, OldCourse, null), JsonRequestBehavior.AllowGet));
        }
        public ActionResult SaveSessionChange(int RegNo, int SessionId, string sessioncall = null)
        {
            FeeManagementService _feeService = new FeeManagementService();
            int UserId = Session["UserId"] != null?Convert.ToInt32(Session["UserId"]) : 0;

            if (!string.IsNullOrEmpty(sessioncall))
            {
                LogActivityViewModel log = new LogActivityViewModel();
                log.EnteredBy       = UserId;
                log.EnteredDate     = DateTime.Now;
                log.ActioName       = "SaveSessionChange";
                log.ModuleName      = "Screenning";
                log.ControllerName  = "Registration";
                log.Activity        = "Change Session";
                log.ActivityMessage = "Session has been changed with RegNo:" + RegNo;
                log.RegistrationNo  = RegNo;
                LogActivityService logActivityService = new LogActivityService();
                logActivityService.CreateLogActivity(log);
            }
            return(Json(_feeService.SaveSessionChange(RegNo, UserId, SessionId), JsonRequestBehavior.AllowGet));
        }
        public ActionResult IsStudentScreenningMedicalClearance(int Id, bool status, string Tag)
        {
            var info = registerService.IsStudentScreenningMedicalClearance(Id, status, Tag);

            if (Tag == "Medical")
            {
                LogActivityViewModel log = new LogActivityViewModel();
                log.EnteredBy       = Convert.ToInt32(Session["UserId"]);
                log.EnteredDate     = DateTime.Now;
                log.ActioName       = "IsStudentScreenningMedicalClearance";
                log.ModuleName      = "Medical";
                log.ControllerName  = "Registration";
                log.Activity        = "Medical Selected";
                log.ActivityMessage = "Medical clearance of registration no " + info.RegistartionNo + " is cleared.";
                log.RegistrationNo  = info.RegistartionNo;
                logActivityService.CreateLogActivity(log);
                Models.Common cm = new Models.Common();
                //  cm.GetResult(info.Email, Convert.ToInt64(info.ApplicationNo), "Selected", "Selected");
            }
            return(Json(info, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 13
0
        public bool SaveUserRegistration(LoginViewModel model)
        {
            bool status = false;

            if (model.Id == 0)
            {
                UserLogin login = new UserLogin
                {
                    Fname       = model.Fname,
                    LName       = model.LName,
                    Department  = model.Department,
                    Designation = model.Designation,
                    Email       = model.Email,
                    IsActive    = true,
                    Password    = model.Password,
                    EnteredDate = DateTime.Now,
                    RoleId      = model.RoleId,
                };
                _context.UserLogins.Add(login);
                if (_context.SaveChanges() == 1)
                {
                    status = true;
                    //========= User Activity ===========
                    LogActivityViewModel log = new LogActivityViewModel();
                    log.EnteredBy       = model.EnteredBy;
                    log.EnteredDate     = DateTime.Now;
                    log.ActioName       = "SaveUserRegistration";
                    log.ModuleName      = "Create User";
                    log.ControllerName  = "Login";
                    log.Activity        = "Create User";
                    log.ActivityMessage = "Add new user '" + model.Fname + (string.IsNullOrEmpty(model.LName) ? "'." : (" " + model.LName + "'."));
                    LogActivityService logActivityService = new LogActivityService();
                    logActivityService.CreateLogActivity(log);
                    //====================================
                }
            }
            return(status);
        }