Exemplo n.º 1
0
        public async Task <ActionResult> Register(RegisterViewModel model)
        {
            if (ModelState.IsValid)
            {
                var user = new ApplicationUser()
                {
                    UserName = model.UserName, BranchCode = model.BranchCode
                };
                var result = await UserManager.CreateAsync(user, model.Password);

                if (result.Succeeded)
                {
                    // await SignInAsync(user, isPersistent: false);
                    //return RedirectToAction("Index", "Home");
                }
                else
                {
                    AddErrors(result);
                }
            }

            ViewBag.BranchName = DAFacade.GetBranchNameListForDropdown(string.Empty);

            // If we got this far, something failed, redisplay form
            return(View(model));
        }
Exemplo n.º 2
0
        public ActionResult UserList()
        {
            List <AspNetUsersEntity> lstEntity = new List <AspNetUsersEntity>();

            lstEntity = DAFacade.GetAspNetUsersListByFilter(string.Empty);
            return(View(lstEntity.ToList()));
        }
Exemplo n.º 3
0
        // GET: /Reports/
        public ActionResult Index()
        {
            List <SalaryPeriodEntity> lstSalaryPeriod = new List <SalaryPeriodEntity>();

            lstSalaryPeriod      = DAFacade.GetSalaryPeriodForDropDown(string.Empty);
            ViewBag.SalaryPeriod = lstSalaryPeriod.ToList();
            return(View());
        }
Exemplo n.º 4
0
        public ActionResult Index()
        {
            List <StructureTypeEntity> lstStructureType = new List <StructureTypeEntity>();

            lstStructureType      = DAFacade.GetStructureTypeListByFilter(string.Format("ScaleYear='2009'"));
            ViewBag.StructureType = lstStructureType.ToList();
            return(View());
        }
Exemplo n.º 5
0
 public PartialViewResult GetBranchInfo(string branchName)
 {
     try
     {
         List <SalaryFixationEntity> lstSalaryFixation = DAFacade.GetSalaryFixationList(string.Format("PostingPlace='{0}'", branchName));
         return(PartialView("_BranchInfo", lstSalaryFixation));
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 6
0
 public PartialViewResult Calculate(string grade, decimal basic, int numberOfChild, int locationID)
 {
     try
     {
         List <SalaryFixationEntity> lstSalaryFixation = DAFacade.CalculateSalaryFix(grade, basic, numberOfChild, locationID);
         return(PartialView("_Calculate", lstSalaryFixation));
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 7
0
 public ActionResult BatchView()
 {
     if (HttpContext.User.Identity.Name.ToLower() == "admin")
     {
         ViewBag.BranchName = DAFacade.GetBranchNameListForDropdown(string.Empty);
     }
     else
     {
         ApplicationDbContext _ctx       = new ApplicationDbContext();
         ApplicationUser      branchCode = _ctx.Users.Where(u => u.UserName == HttpContext.User.Identity.Name).FirstOrDefault();
         ViewBag.BranchName = DAFacade.GetBranchNameListForDropdown(string.Format("BranchCode='{0}'", branchCode.BranchCode));
     }
     return(View());
 }
Exemplo n.º 8
0
 public PartialViewResult GetIndividualSalaryFixationInfo(string empCode)
 {
     try
     {
         string currentUserBranchCode = string.Empty;
         if (HttpContext.User.Identity.Name.ToLower() == "admin")
         {
             currentUserBranchCode = "admin";
         }
         else
         {
             ApplicationDbContext _ctx       = new ApplicationDbContext();
             ApplicationUser      branchCode = _ctx.Users.Where(u => u.UserName == HttpContext.User.Identity.Name).FirstOrDefault();
             currentUserBranchCode = branchCode.BranchCode;
         }
         List <SalaryFixationEntity> lstSalaryFixation = DAFacade.GetSalaryFixationList(string.Format("EmpCode='{0}' and  BranchCode = case when  '{1}' = 'admin' then BranchCode else '{1}' end", empCode, currentUserBranchCode));
         return(PartialView("_IndividualSalaryFixationInfo", lstSalaryFixation));
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 9
0
        public ActionResult Register()
        {
            ViewBag.BranchName = DAFacade.GetBranchNameListForDropdown(string.Empty);

            return(View());
        }