// GET: EmployeeDesignation
        public ActionResult EmployeeDesignation()
        {
            ViewBag.FirstCode   = LoadComboBox.LoadAllAITS_Codes(1);
            ViewBag.SecondCode  = LoadComboBox.LoadAllAITS_Codes(2);
            ViewBag.Designation = LoadComboBox.LoadAllAITS_Designation();
            var allEmployeeDesg = context.AITS_EmployeeDesignation.ToList();

            if (allEmployeeDesg != null)
            {
                allEmployeeDesg.ForEach(x =>
                {
                    x.DesignationName = context.AITS_Designations.FirstOrDefault(p => p.ID == x.DesignationID).DesignationName;
                    x.EmployeeName    = context.AITS_Employee.FirstOrDefault(p => p.EmpID == x.EmpID).EmployeeName;
                    x.FirstCodeName   = context.AITS_Codes.FirstOrDefault(p => p.CodeID == x.FirstCode).CodeName;
                    x.SecondCodeName  = context.AITS_Codes.FirstOrDefault(p => p.CodeID == x.SecondCode).CodeName;
                });
            }
            ViewBag.EmployeeDesignation = allEmployeeDesg;
            ViewBag.employees           = LoadComboBox.LoadAllAITS_Employees();
            var id = context.AITS_EmployeeDesignation.ToList().OrderBy(x => x.ID).LastOrDefault();

            if (id != null)
            {
                ViewBag.ID = id.ID + 1;
            }
            else
            {
                ViewBag.ID = 1;
            }

            return(View());
        }
Exemplo n.º 2
0
        // GET: AITS_SaleEntry
        public ActionResult AITS_SaleEntry()
        {
            ViewBag.employees = LoadComboBox.LoadAllAITS_Employees();
            ViewBag.codes     = LoadComboBox.LoadAllAITS_Codes(3);
            var items = context.AITS_SaleEntry.ToList();

            if (items.Count() != 0)
            {
                items.ForEach(x =>
                {
                    x.CodeName     = context.AITS_Codes.FirstOrDefault(p => p.CodeID == x.CodeID).CodeName;
                    x.EmployeeName = context.AITS_Employee.FirstOrDefault(p => p.EmpID == x.EmployeeID).EmployeeName;
                });
            }
            ViewBag.SalesEntry = items;

            var id = context.AITS_SaleEntry.ToList().OrderBy(x => x.ID).LastOrDefault();

            if (id != null)
            {
                ViewBag.EmpID = id.ID + 1;
            }
            else
            {
                ViewBag.EmpID = 1;
            }
            return(View());
        }
Exemplo n.º 3
0
        // GET: AITS_Employee
        public ActionResult AITS_Employee()
        {
            ViewBag.employees = LoadComboBox.LoadAllAITS_Employees();
            var Employee = context.AITS_Employee.ToList();

            Employee.ForEach(x =>
            {
                if (x.ReferenceEmpID != 0)
                {
                    x.RefeneceName = context.AITS_Employee.FirstOrDefault(m => m.EmpID == x.ReferenceEmpID).EmployeeName;
                }
            });
            ViewBag.Employee = Employee;

            var id = context.AITS_Employee.ToList().OrderBy(x => x.EmpID).LastOrDefault();

            if (id != null)
            {
                ViewBag.EmpID = id.EmpID + 1;
            }
            else
            {
                ViewBag.EmpID = 1;
            }
            return(View());
        }
Exemplo n.º 4
0
 public ActionResult GetEmployeeInfo(int ID)
 {
     if (ID == 0)
     {
         return(Json(new { Message = 0 }, JsonRequestBehavior.AllowGet));
     }
     else
     {
         var employee = context.AITS_EmployeeDesignation.FirstOrDefault(m => m.EmpID == ID);
         var codes    = LoadComboBox.LoadAllAITS_codesbyemp(ID);
         employee.DesignationName = (from p in context.AITS_EmployeeDesignation
                                     join c in context.AITS_Designations on p.DesignationID equals c.ID
                                     where p.EmpID == ID
                                     select c.DesignationName).FirstOrDefault();
         return(Json(new { employee = employee, codes = codes }, JsonRequestBehavior.AllowGet));
     }
 }
Exemplo n.º 5
0
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            LoadComboBox load = new LoadComboBox();

            load.LoadCombo(comboBoxPosition);
        }
Exemplo n.º 6
0
 // GET: AITS_Commission
 public ActionResult AITS_Commission()
 {
     ViewBag.Employee = LoadComboBox.LoadAllAITS_Employees();
     return(View());
 }
 // GET: AITS_AssociateSearch
 public ActionResult AITS_AssociateSearch()
 {
     ViewBag.Employee = LoadComboBox.LoadAllAITS_Employees();
     return(View());
 }