Ejemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("Id,ComId,Name")] Designation designation)
        {
            if (ModelState.IsValid)
            {
                designation.ComId = session.GetString("ComSessionId");
                _context.Add(designation);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(designation));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("Id,ComId,Leavetype,Value")] LeaveSetup leaveSetup)
        {
            if (ModelState.IsValid)
            {
                leaveSetup.ComId = session.GetString("ComSessionId");
                _context.Add(leaveSetup);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(leaveSetup));
        }
Ejemplo n.º 3
0
        public async Task <IActionResult> Create([Bind("Id,ComId,Fromdt,Todt,Hstatus")] Holiday holiday)
        {
            if (ModelState.IsValid)
            {
                holiday.ComId = session.GetString("ComSessionId");
                _context.Add(holiday);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(holiday));
        }
        public async Task <IActionResult> Create([Bind("Id,ComId,Name")] Designation designation)
        {
            if (ModelState.IsValid)
            {
                _context.Add(designation);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ComId"] = new SelectList(_context.UserResistration, "ComId", "ComId", designation.ComId);
            return(View(designation));
        }
        public async Task <IActionResult> Create([Bind("Id,ComId,EmpId,Cl,Sl,El,Ml,Acl,Bcl,Asl,Bsl,Ael,Bel,Aml,Bml")] LeaveBalance leaveBalance)
        {
            if (ModelState.IsValid)
            {
                _context.Add(leaveBalance);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ComId"] = new SelectList(_context.UserResistration, "ComId", "ComId", leaveBalance.ComId);
            ViewData["EmpId"] = new SelectList(_context.EmployeeInfo, "Id", "Id", leaveBalance.EmpId);
            return(View(leaveBalance));
        }
        public async Task <IActionResult> Create([Bind("Id,ComId,Name,Code,Phone,Email,Address,JoinDate,BirthDate,Sex,Religion,SectionId,DesignationId,Gs")] EmployeeInfo employeeInfo)
        {
            if (ModelState.IsValid)
            {
                _context.Add(employeeInfo);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ComId"]         = new SelectList(_context.UserResistration, "ComId", "ComId", employeeInfo.ComId);
            ViewData["DesignationId"] = new SelectList(_context.Designation, "Id", "Name", employeeInfo.DesignationId);
            ViewData["SectionId"]     = new SelectList(_context.Section, "Id", "Name", employeeInfo.SectionId);
            return(View(employeeInfo));
        }
Ejemplo n.º 7
0
        public async Task <IActionResult> Create([Bind("Id,ComId,EmpId,FromDate,ToDate,LvDays,LeaveId,Remarks")] LeaveInput leaveInput)
        {
            if (ModelState.IsValid)
            {
                leaveInput.ComId = session.GetString("ComSessionId");
                _context.Add(leaveInput);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EmpId"]   = new SelectList(_context.EmployeeInfo, "Id", "Name", leaveInput.EmpId);
            ViewData["LeaveId"] = new SelectList(_context.LeaveSetup, "Id", "Leavetype", leaveInput.LeaveId);
            return(View(leaveInput));
        }
        public async Task <IActionResult> Create([Bind("ComId,ComName,ComAddress,ComType")] UserResistration companyInfo)
        {
            if (ModelState.IsValid)
            {
                Guid g;
                g = Guid.NewGuid();
                companyInfo.ComId = g.ToString();
                _context.Add(companyInfo);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(companyInfo));
        }
        public async Task <IActionResult> Create([Bind("Id,ComId,Name,Code,Phone,Email,Address,JoinDate,BirthDate,Sex,Religion,SectionId,DesignationId,Gs")] EmployeeInfo employeeInfo)
        {
            if (ModelState.IsValid)
            {
                Guid g;
                g = new Guid();
                employeeInfo.ComId = session.GetString("ComSessionId");
                employeeInfo.Id    = g.ToString();
                _context.Add(employeeInfo);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DesignationId"] = new SelectList(_context.Designation.Where(d => d.ComId == session.GetString("ComSessionId")), "Id", "Name");
            ViewData["SectionId"]     = new SelectList(_context.Section.Where(s => s.ComId == session.GetString("ComSessionId")), "Id", "Name");
            return(View(employeeInfo));
        }
Ejemplo n.º 10
0
        public async Task <IActionResult> Create([Bind("Id,ComId,RoleId,UserId")] UserRole userRole)
        {
            if (session.GetString("Role") != "Admin")
            {
                return(LocalRedirect("/"));
            }
            if (ModelState.IsValid)
            {
                userRole.ComId = session.GetString("ComSessionId");
                _context.Add(userRole);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["RoleId"] = new SelectList(_context.Role, "Id", "RoleName");
            ViewData["UserId"] = new SelectList(_db.AspNetUsers, "Id", "UserName");
            return(View(userRole));
        }