Esempio n. 1
0
        public async Task <IActionResult> Create([Bind("Disputid,OrederId,ArbiterId,Result,StartDate,FinishDate,Status,TimeToFinish")] Dispute dispute)
        {
            if (ModelState.IsValid)
            {
                _context.Add(dispute);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ArbiterId"] = new SelectList(_context.Employee, "EmpId", "Institute", dispute.ArbiterId);
            ViewData["OrederId"]  = new SelectList(_context.Order, "OrderId", "OrderId", dispute.OrederId);
            return(View(dispute));
        }
Esempio n. 2
0
        public async Task <IActionResult> Create([Bind("ServiceId,UserId,CatId,Desc,Physicalitems,DeliveryTime,Price")] Service service)
        {
            if (ModelState.IsValid)
            {
                _context.Add(service);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CatId"]  = new SelectList(_context.ServiceCategory, "CatId", "CatId", service.CatId);
            ViewData["UserId"] = new SelectList(_context.UserInfo, "NatId", "Email", service.UserId);
            return(View(service));
        }
Esempio n. 3
0
        public async Task <IActionResult> Create([Bind("NatId,Fname,Fathername,Lname,BirthDate,UserType,Status,RatePoints,Phone,Email,GovId,City,Address,Homelocation,Gender")] UserInfo userInfo)
        {
            if (ModelState.IsValid)
            {
                _context.Add(userInfo);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["GovId"]    = new SelectList(_context.Governorate, "GovId", "GovId", userInfo.GovId);
            ViewData["UserType"] = new SelectList(_context.UserType, "UserTypeId", "UserTypeId", userInfo.UserType);
            return(View(userInfo));
        }
Esempio n. 4
0
        public async Task <IActionResult> Create([Bind("EmpId,UserId,SocialInsuranceId,Qualfication,Institute,AuthorityLevel,SupervisedBy")] Employee employee)
        {
            if (ModelState.IsValid)
            {
                _context.Add(employee);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AuthorityLevel"] = new SelectList(_context.AuthorityLevel, "Id", "Title", employee.AuthorityLevel);
            ViewData["SupervisedBy"]   = new SelectList(_context.Employee, "EmpId", "Institute", employee.SupervisedBy);
            ViewData["UserId"]         = new SelectList(_context.UserInfo, "NatId", "Email", employee.UserId);
            return(View(employee));
        }
Esempio n. 5
0
        public async Task <IActionResult> Create([Bind("ReportId,UserId,Type,EmpId,Files")] Report report)
        {
            if (ModelState.IsValid)
            {
                _context.Add(report);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EmpId"]  = new SelectList(_context.Employee, "EmpId", "Institute", report.EmpId);
            ViewData["Type"]   = new SelectList(_context.ReportTypes, "Id", "Id", report.Type);
            ViewData["UserId"] = new SelectList(_context.UserInfo, "NatId", "Address", report.UserId);
            return(View(report));
        }
Esempio n. 6
0
        public async Task <IActionResult> Create([Bind("OrderId,UserId,ServiceId,ShippmentId,Quantity,OrderStatus,StartDate,FinishDate,CloseCode,RatePoint")] Order order)
        {
            if (ModelState.IsValid)
            {
                _context.Add(order);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ServiceId"]   = new SelectList(_context.Service, "ServiceId", "Desc", order.ServiceId);
            ViewData["ShippmentId"] = new SelectList(_context.Shipment, "ShipmentId", "ShipmentId", order.ShippmentId);
            ViewData["UserId"]      = new SelectList(_context.UserInfo, "NatId", "Address", order.UserId);
            return(View(order));
        }