Пример #1
0
        public ActionResult Update(long id, EmployeeItem item)
        {
            var Employee = _context.EmployeeItems.Find(id);

            if (Employee == null)
            {
                return(NotFound());
            }

            if (!IsLegal(item))
            {
                return(CreatedAtRoute("message", "信息不合法"));
            }

            Employee.Id         = item.Id;
            Employee.FirstName  = item.FirstName;
            Employee.LastName   = item.LastName;
            Employee.Gender     = item.Gender;
            Employee.Email      = item.Email;
            Employee.Birth      = item.Birth;
            Employee.Address    = item.Address;
            Employee.Phone      = item.Phone;
            Employee.Department = item.Department;

            _context.EmployeeItems.Update(Employee);
            _context.SaveChanges();
            return(NoContent());
        }
Пример #2
0
        private void DisplayValues()
        {
            if (canDisplay)
            {
                try
                {
                    if (selectedEmpId != "" && selectedEmpId != null)
                    {
                        canDisplay    = false;
                        mEmployeeItem = new EmployeeItem();
                        mEmployeeItem = mEmployeeCollection.RetreiveSpecificEmployee(selectedEmpId);

                        //tbFirstName.Text = mEmployeeItem._firstName.ToString();
                        //tbMiddleName.Text = mEmployeeItem._middleName.ToString();
                        //tbLastName.Text = mEmployeeItem._lastName.ToString();
                        //tbNationality.Text = mEmployeeItem._nationality.ToString();
                        //tbReligion.Text = mEmployeeItem._religion.ToString();
                        //tbPresentAddress.Text = mEmployeeItem._presentAddress.ToString();
                        //tbPermanentAddress.Text = mEmployeeItem._permanentAddress.ToString();
                        //tbEmail.Text = mEmployeeItem._eMail.ToString();
                        //tbContactNumber.Text = mEmployeeItem._contactNum.ToString();
                        //tbEmployeeId.Text = mEmployeeItem._employeeId.ToString();
                    }
                }
                catch (Exception)
                {
                    System.Windows.MessageBox.Show("Error");
                }
            }
        }
        public async Task <IActionResult> PutEmployeeItem(int id, EmployeeItem employeeItem)
        {
            if (id != employeeItem.Id)
            {
                return(BadRequest());
            }

            _context.Entry(employeeItem).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!EmployeeItemExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <ActionResult <EmployeeItem> > PostTodoItem(EmployeeItem func)
        {
            _context.Employees.Add(func);
            await _context.SaveChangesAsync();

            return(CreatedAtAction(nameof(GetFunc), new { id = func.ID }, func));
        }
Пример #5
0
        public ActionResult EmpReport()
        {
            EmployeeItem objEmpItem = new EmployeeItem();

            List <EmployeeItem> lstEmp    = new List <EmployeeItem>();
            ReportService       objmethod = new ReportService();
            int cid = 0;

            if (Session["CompID"] != null)
            {
                cid = Convert.ToInt32(Session["CompID"].ToString());
            }
            lstEmp = objmethod.GetData(cid);

            objEmpItem.EmployeeList = new List <EmployeeItem>();
            objEmpItem.EmployeeList.AddRange(lstEmp);

            //#region Bind DropDown comp
            List <CompanyItem> objCompany     = new List <CompanyItem>();
            CompanyService     objListCompany = new CompanyService();

            objCompany          = objListCompany.GetALL();
            objEmpItem.ListComp = new List <CompanyItem>();
            objEmpItem.ListComp.AddRange(objCompany);

            //#endregion
            ViewBag.Menuid = Request.QueryString["menuId"];
            return(View(objEmpItem));
        }
 public EmployeeTest()
 {
     _testContext = new TestContext();
     _item        = new EmployeeItem {
         ID = 1, Nome = "Carina", Email = "teste", Departamento = "RH"
     };
 }
Пример #7
0
        private void UpdateEmployee()
        {
            mEmployeeItem = new EmployeeItem();

            //mEmployeeItem._employeeId = tbEmployeeId.Text;
            //mEmployeeItem._firstName = tbFirstName.Text;
            //mEmployeeItem._middleName = tbMiddleName.Text;
            //mEmployeeItem._lastName = tbLastName.Text;
            //mEmployeeItem._nationality = tbNationality.Text;
            //mEmployeeItem._religion = tbReligion.Text;
            //mEmployeeItem._eMail = tbEmail.Text;
            //mEmployeeItem._contactNum = tbContactNumber.Text;
            //mEmployeeItem._presentAddress = tbPresentAddress.Text;
            //mEmployeeItem._permanentAddress = tbPermanentAddress.Text;

            try
            {
                mEmployeeManager.UpdateData(mEmployeeItem);
                System.Windows.MessageBox.Show("Employee details succesfully updated.");
            }
            catch (Exception)
            {
                System.Windows.MessageBox.Show("Error updating employee.");
            }
        }
Пример #8
0
        public ActionResult <EmployeeItem> PostEmployee(EmployeeItem item)
        {
            _context.EmployeeItems.Add(item);
            _context.SaveChangesAsync();

            return(CreatedAtAction(nameof(GetEmployee), new { id = item.id }, item));
        }
Пример #9
0
        public ViewEmployeeDetails(EmployeeItem empItem, List <EducationItem> eduList, List <ExperienceItem> expList, List <TrainingItem> trainList)
        {
            InitializeComponent();

            dpBirthday.SelectedDate          = DateTime.Today;
            dpDateEmployed.SelectedDate      = DateTime.Today;
            dpEduDoctoralDate.SelectedDate   = DateTime.Today;
            dpEduMasteralDate.SelectedDate   = DateTime.Today;
            dpEduPrimaryDate.SelectedDate    = DateTime.Today;
            dpEduSecondaryDate.SelectedDate  = DateTime.Today;
            dpEduTertiaryDate.SelectedDate   = DateTime.Today;
            dpEduVocationalDate.SelectedDate = DateTime.Today;
            dpEndProvision.SelectedDate      = DateTime.Today;
            dpTrainingFinished.SelectedDate  = DateTime.Today;
            dpWorkEnd.SelectedDate           = DateTime.Today;
            dpWorkStart.SelectedDate         = DateTime.Today;

            cbPosition.ItemsSource  = StaticPositionCollection.staticPositionList;
            cbEmpStatus.ItemsSource = Enum.GetValues(typeof(EmployeeStatus)).Cast <EmployeeStatus>();

            mEmpItem   = empItem;
            mEduList   = eduList;
            mExpList   = expList;
            mTrainList = trainList;
        }
Пример #10
0
        private void ButtonViewEmployee_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(selectedEmployeeId))
            {
                MessageBox.Show("Please select employee");
            }
            else
            {
                EducationCollection  selectedEduList   = new EducationCollection();
                ExperienceCollection selectedExpList   = new ExperienceCollection();
                TrainingCollection   selectedTrainList = new TrainingCollection();

                var vEmpItem   = new EmployeeItem();
                var vEduList   = new List <EducationItem>();
                var vExpList   = new List <ExperienceItem>();
                var vTrainList = new List <TrainingItem>();
                vEmpItem   = empCollection.Where(t => t._EMP_NO.Equals(selectedEmployeeId)).FirstOrDefault();
                vEduList   = selectedEduList.RetreiveEmpEducation(vEmpItem._EMP_NO);
                vExpList   = selectedExpList.RetreiveEmpExperience(vEmpItem._EMP_NO);
                vTrainList = selectedTrainList.RetreiveEmpTraining(vEmpItem._EMP_NO);
                ViewEmployeeDetails viewEmp = new ViewEmployeeDetails(vEmpItem, vEduList, vExpList, vTrainList);
                EmployeeManagement.mEmpTransitioner.Items.Add(viewEmp);
                EmployeeManagement.mEmpTransitioner.SelectedIndex = 1;
                GetAllEmployees();
            }
        }
Пример #11
0
        private void ButtonSave_Click(object sender, RoutedEventArgs e)
        {
            EmployeeItem item = new EmployeeItem();

            item._employeeId       = tbEmployeeId.Text;
            item._firstName        = tbFirstName.Text;
            item._middleName       = tbMiddleName.Text;
            item._lastName         = tbLastName.Text;
            item._nationality      = tbNationality.Text;
            item._eMail            = tbEmail.Text;
            item._contactNum       = tbContactNumber.Text;
            item._religion         = tbReligion.Text;
            item._presentAddress   = tbPresentAddress.Text;
            item._permanentAddress = tbPermanentAddress.Text;

            try
            {
                SaveEmpoyeeDetails(item);
                MessageBox.Show("New Employee added.");
            }
            catch (System.Exception)
            {
                MessageBox.Show("Error saving new employee.");
            }

            EmployeeCollection myEmpList = new EmployeeCollection();

            myEmpList.RetreiveAllEmployee();

            EmployeeManagement.mEmpTransitioner.SelectedIndex = 0;

            ClearInputFields();
        }
        void EmailerClicked(System.Object sender, System.EventArgs e)
        {
            try
            {
                List <string> recipients = new List <string>();
                EmployeeItem  empItem    = (EmployeeItem)BindingContext;


                recipients.Add(empItem.Email);


                var message = new EmailMessage
                {
                    //Subject = subject,
                    //Body = body,
                    To = recipients
                         //Cc = ccRecipients,
                         //Bcc = bccRecipients
                };
                Email.ComposeAsync(message);
            }
            catch (Exception ex)
            {
                //Debug.WriteLine("Exception:>>" + ex);
                DisplayAlert("Error", ex.InnerException.ToString(), "OK");
            }
        }
        public static EmployeeItemViewModel ConvertToEmployeeItemViewModel(this EmployeeItem EmployeeItem)
        {
            EmployeeItemViewModel EmployeeItemViewModel = new EmployeeItemViewModel()
            {
                Id         = EmployeeItem.Id,
                Identifier = EmployeeItem.Identifier,

                Employee     = EmployeeItem.Employee?.ConvertToEmployeeViewModelLite(),
                FamilyMember = EmployeeItem.FamilyMember?.ConvertToFamilyMemberViewModelLite(),

                Name = EmployeeItem.Name,

                DateOfBirth = EmployeeItem.DateOfBirth,
                EmbassyDate = EmployeeItem.EmbassyDate,
                ItemStatus  = EmployeeItem.ItemStatus,
                IsActive    = EmployeeItem.Active,

                CreatedBy = EmployeeItem.CreatedBy?.ConvertToUserViewModelLite(),
                Company   = EmployeeItem.Company?.ConvertToCompanyViewModelLite(),

                UpdatedAt = EmployeeItem.UpdatedAt,
                CreatedAt = EmployeeItem.CreatedAt
            };

            return(EmployeeItemViewModel);
        }
        public static EmployeeItem ConvertToEmployeeItem(this EmployeeItemViewModel EmployeeItemViewModel)
        {
            EmployeeItem EmployeeItem = new EmployeeItem()
            {
                Id         = EmployeeItemViewModel.Id,
                Identifier = EmployeeItemViewModel.Identifier,

                EmployeeId     = EmployeeItemViewModel.Employee?.Id ?? null,
                FamilyMemberId = EmployeeItemViewModel.FamilyMember?.Id ?? null,

                Name = EmployeeItemViewModel.Name,

                DateOfBirth = (DateTime)EmployeeItemViewModel.DateOfBirth,
                EmbassyDate = EmployeeItemViewModel.EmbassyDate,
                ItemStatus  = EmployeeItemViewModel.ItemStatus,
                Active      = EmployeeItemViewModel.IsActive,
                CreatedById = EmployeeItemViewModel.CreatedBy?.Id ?? null,
                CompanyId   = EmployeeItemViewModel.Company?.Id ?? null,

                CreatedAt = EmployeeItemViewModel.CreatedAt,
                UpdatedAt = EmployeeItemViewModel.UpdatedAt
            };

            return(EmployeeItem);
        }
Пример #15
0
        public EmployeeItem listdata(EmployeeItem model, string id)
        {
            var list_position_title = _employeeBLL.GetEmployee().Select(x => new { x.POSITION_TITLE }).ToList().Distinct().OrderBy(x => x.POSITION_TITLE);

            model.PositionTitleList = new SelectList(list_position_title, "POSITION_TITLE", "POSITION_TITLE");
            var list_divison_title = _employeeBLL.GetEmployee().Select(x => new { x.DIVISON }).ToList().Distinct().OrderBy(x => x.DIVISON);

            model.DivisonList = new SelectList(list_divison_title, "DIVISON", "DIVISON");
            var list_directorate = _employeeBLL.GetEmployee().Select(x => new { x.DIRECTORATE }).ToList().Distinct().OrderBy(x => x.DIRECTORATE);

            model.DirectorateList = new SelectList(list_directorate, "DIRECTORATE", "DIRECTORATE");
            var list_city = _employeeBLL.GetEmployee().Select(x => new { x.CITY, x.BASETOWN }).ToList().Distinct().Where(x => x.BASETOWN == id).OrderBy(x => x.CITY);

            model.CityList = new SelectList(list_city, "CITY", "CITY");
            var list_basetown = _employeeBLL.GetEmployee().Select(x => new { x.BASETOWN }).ToList().Distinct().OrderBy(x => x.BASETOWN);

            model.BaseTownList = new SelectList(list_basetown, "BASETOWN", "BASETOWN");
            var list_company = _employeeBLL.GetEmployee().Select(x => new { x.COMPANY }).ToList().Distinct().OrderBy(x => x.COMPANY);

            model.CompanyList = new SelectList(list_company, "COMPANY", "COMPANY");
            var list_group_level = _employeeBLL.GetEmployee().Select(x => new { x.GROUP_LEVEL }).ToList().Distinct().OrderBy(x => x.GROUP_LEVEL);

            model.GroupLevelList = new SelectList(list_group_level, "GROUP_LEVEL", "GROUP_LEVEL");
            var list_flext_point = _employeeBLL.GetEmployee().Select(x => new { x.FLEX_POINT }).ToList().Distinct().OrderBy(x => x.FLEX_POINT);

            model.FlexPointlList = new SelectList(list_flext_point, "FLEX_POINT", "FLEX_POINT");
            var list_address = _employeeBLL.GetEmployee().Select(x => new { x.ADDRESS, x.BASETOWN }).ToList().Distinct().Where(x => x.BASETOWN == id).OrderBy(x => x.ADDRESS);

            model.AddressList = new SelectList(list_address, "ADDRESS", "ADDRESS");
            return(model);
        }
Пример #16
0
        public IActionResult Create(EmployeeItem item)
        {
            _context.EmployeeItems.Add(item);
            _context.SaveChanges();

            return(CreatedAtRoute("GetEmployee", new { id = item.Id }, item));
        }
Пример #17
0
        public async Task <ActionResult <EmployeeItem> > PostEmployeeItem(EmployeeItem employeeItem)
        {
            _context.EmployeeItem.Add(employeeItem);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetEmployeeItem", new { id = employeeItem.Id }, employeeItem));
        }
Пример #18
0
        public ActionResult Create()
        {
            int Empid = Convert.ToInt32(Url.RequestContext.RouteData.Values["id"].ToString());

            objVisas = new EmpVisaService();

            ViewBag.Empid = Empid;

            List <EmpVisaItem> listVisa = new List <EmpVisaItem>();

            listVisa = objVisas.VisaListData(Empid);
            EmpVisaItem objlistVisaitem = new EmpVisaItem();

            objlistVisaitem.ListVisa = new List <EmpVisaItem>();
            objlistVisaitem.ListVisa.AddRange(listVisa);

            List <clsMasterData> lstMData = new List <clsMasterData>();

            lstMData = objVisas.GetVisaStatus();
            objlistVisaitem.MasterDetails = new List <clsMasterData>();
            objlistVisaitem.MasterDetails.AddRange(lstMData);

            listVisa = objVisas.GetVisaDoc(Empid);
            objlistVisaitem.ListVisaDoc = new List <EmpVisaItem>();
            objlistVisaitem.ListVisaDoc.AddRange(listVisa);

            #region For Emirates Bind
            List <clsMasterData> lstEmirates = new List <clsMasterData>();
            lstEmirates = objVisas.GetEmiratesStatus();
            objlistVisaitem.EmiratesList = new List <clsMasterData>();
            objlistVisaitem.EmiratesList.AddRange(lstEmirates);
            #endregion
            #region Bind DropDown Country
            List <clsMasterData> lstMasters = new List <clsMasterData>();
            lstMasters = objVisas.getCountry();
            objlistVisaitem.ListCountry = new List <clsMasterData>();
            objlistVisaitem.ListCountry.AddRange(lstMasters);

            #endregion
            #region ddl company
            List <CompanyItem> objCompany     = new List <CompanyItem>();
            CompanyService     objListCompany = new CompanyService();
            objCompany = objListCompany.GetALL();

            EmployeeItem objEmpItem = new EmployeeItem();
            objlistVisaitem.ListComp = new List <CompanyItem>();
            objlistVisaitem.ListComp.AddRange(objCompany);
            #endregion

            #region ddl visa type
            List <clsMasterData> lstMData1 = new List <clsMasterData>();
            lstMData1 = objVisas.GetVisaType();
            objlistVisaitem.ListVisaType = new List <clsMasterData>();
            objlistVisaitem.ListVisaType.AddRange(lstMData1);
            #endregion

            ViewBag.Menuid = Request.QueryString["menuId"];
            return(View(objlistVisaitem));
        }
Пример #19
0
        public JsonResult UploadFile(HttpPostedFileBase upload)
        {
            var qtyPacked = string.Empty;
            var qty       = string.Empty;

            var data  = (new ExcelReader()).ReadExcel(upload);
            var model = new List <EmployeeItem>();

            if (data != null)
            {
                foreach (var dataRow in data.DataRows)
                {
                    if (dataRow[0] == "")
                    {
                        continue;
                    }
                    var item = new EmployeeItem();
                    item.EMPLOYEE_ID    = dataRow[0];
                    item.FORMAL_NAME    = dataRow[1].ToString();
                    item.POSITION_TITLE = dataRow[2].ToString();
                    item.DIVISON        = dataRow[3].ToString();
                    item.DIRECTORATE    = dataRow[4].ToString();
                    if (dataRow[5] != "")
                    {
                        item.ADDRESS = dataRow[5].ToString();
                    }
                    else
                    {
                        item.ADDRESS = null;
                    }
                    item.CITY        = dataRow[6].ToString();
                    item.BASETOWN    = dataRow[7].ToString();
                    item.COMPANY     = dataRow[8].ToString();
                    item.COST_CENTER = dataRow[9].ToString();
                    if (dataRow[10] != "")
                    {
                        item.GROUP_LEVEL = Convert.ToInt32(dataRow[10].ToString());
                    }
                    if (dataRow[11] != "")
                    {
                        item.FLEX_POINT = Convert.ToInt32(dataRow[11].ToString());
                    }
                    if (dataRow[12] != "")
                    {
                        item.EMAIL_ADDRESS = dataRow[12].ToString();
                    }
                    else
                    {
                        item.EMAIL_ADDRESS = null;
                    }
                    item.CREATED_BY    = CurrentUser.USERNAME;
                    item.CREATED_DATE  = DateTime.Now;
                    item.MODIFIED_DATE = null;
                    item.IS_ACTIVE     = true;
                    model.Add(item);
                }
            }
            return(Json(model));
        }
Пример #20
0
        public ActionResult IDCard(int id)
        {
            EmployeeService objmethod = new EmployeeService();
            EmployeeItem    objmaster = new EmployeeItem();

            objmaster = objmethod.getEmpByID(id);
            return(View(objmaster));
        }
Пример #21
0
        public EmployeeItem GetById(int id)
        {
            Mapper.CreateMap <employee_master, EmployeeItem>();
            employee_master objmaster  = DbContext.employee_master.SingleOrDefault(m => m.id == id);
            EmployeeItem    objmasterp = Mapper.Map <EmployeeItem>(objmaster);

            return(objmasterp);
        }
Пример #22
0
        public async Task SaveAsync(EmployeeItem employeeItem)
        {
            var isNew = employeeItem.Id == default(long);

            _context.Entry(employeeItem).State = isNew ? EntityState.Added : EntityState.Modified;

            await _context.SaveChangesAsync();
        }
Пример #23
0
        public ActionResult GetBaseTownDataJson(string id)
        {
            var model = new EmployeeItem();

            model.MainMenu     = _mainMenu;
            model.CurrentLogin = CurrentUser;
            model = listdata(model, id);
            return(Json(model, JsonRequestBehavior.AllowGet));
        }
Пример #24
0
        //[HttpPost]
        //public ActionResult Create(EmployeeItem model)
        //{
        //    if (model.Empname != null)
        //    {
        //        EmployeeService objEmpService = new EmployeeService();

        //        HttpPostedFileBase file = Request.Files["file"];
        //        var fileName = Path.GetFileName(file.FileName);
        //        var path = Path.Combine(Server.MapPath("../PhotoUpload"), fileName);
        //        file.SaveAs(path);
        //        model.Photo = fileName;
        //        model.CreatedDate = System.DateTime.Now;
        //        int p = objEmpService.Insert(model);

        //        return RedirectToAction("Create", "Employee");
        //    }
        //    else
        //    {
        //        ModelState.AddModelError("", "");
        //        return RedirectToAction("Create", "Employee");
        //    }


        //}
        public ActionResult View(int id)
        {
            EmployeeService objmethod = new EmployeeService();
            EmployeeItem    objmaster = new EmployeeItem();

            objmaster = objmethod.GetById(id);

            Session["PhotoId"] = objmaster.Photo;

            List <EmployeeItem> lstmasterp = new List <EmployeeItem>();

            objmaster.EmployeeList = new List <EmployeeItem>();
            objmaster.EmployeeList.AddRange(lstmasterp);

            //Added by Kuldip Patel @07-06-2016
            #region Bind RDB Working Status
            List <clsMasterData> lstMasters1  = new List <clsMasterData>();
            EmployeeService      objclsmethod = new EmployeeService();
            lstMasters1 = objclsmethod.GetWorkingStatus();

            EmployeeItem objItem = new EmployeeItem();
            objmaster.listMasterWS = new List <clsMasterData>();
            objmaster.listMasterWS.AddRange(lstMasters1);

            #endregion
            #region Company Bind
            List <CompanyItem> objCompany     = new List <CompanyItem>();
            CompanyService     objListCompany = new CompanyService();
            objCompany = objListCompany.GetALL();


            objmaster.CompanyList = new List <CompanyItem>();
            objmaster.CompanyList.AddRange(objCompany);

            #endregion
            //For Bind Branch
            #region  Bind Branch
            List <BranchItem> objbranchitm     = new List <BranchItem>();
            BranchService     objbranchservice = new BranchService();
            objbranchitm = objbranchservice.GetAll();

            //objEmpItem = new EmployeeItem();
            objmaster.BranchList = new List <BranchItem>();
            objmaster.BranchList.AddRange(objbranchitm);
            #endregion
            //ViewBag.EmpId = id;
            //EmployeeService objEMP = new EmployeeService();
            //string s;
            //s = objEMP.getEMP(id);

            //ViewBag.EmpName = s;

            EmpAllItem objAllItem = new EmpAllItem();
            objAllItem.EmployeeItem = objmaster;
            return(View(objAllItem));
        }
Пример #25
0
 public UserCreateViewModel(EmployeeItem user) :
     this()
 {
     UserId      = user.Id;
     FirstName   = user.FirstName;
     LastName    = user.LastName;
     Email       = user.Email;
     PhoneNumber = user.Phone;
     Address     = user.Address;
 }
        public static List <EmployeeItemViewModel> ConvertToEmployeeItemViewModelList(this IEnumerable <EmployeeItem> EmployeeItems)
        {
            List <EmployeeItemViewModel> EmployeeItemViewModels = new List <EmployeeItemViewModel>();

            foreach (EmployeeItem EmployeeItem in EmployeeItems)
            {
                EmployeeItemViewModels.Add(EmployeeItem.ConvertToEmployeeItemViewModel());
            }
            return(EmployeeItemViewModels);
        }
Пример #27
0
        private void ButtonViewEmployee_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            var vEmpItem = new EmployeeItem();

            vEmpItem = empCollection.Where(t => t._EMP_NO.Equals(selectedEmployeeId)).FirstOrDefault();
            ViewEmployeeDetails viewEmp = new ViewEmployeeDetails(vEmpItem);

            EmployeeManagement.mEmpTransitioner.Items.Add(viewEmp);
            EmployeeManagement.mEmpTransitioner.SelectedIndex = 1;
            GetAllEmployees();
        }
Пример #28
0
        public async Task <string> insertUpdate(EmployeeItem _employee)
        {
            RepGen            reposGen = new Repository.RepGen();
            DynamicParameters param    = new DynamicParameters();

            //param.Add("@id", _user.id);
            //param.Add("@name", _user.name);
            //param.Add("@address", _user.address);
            //param.Add("@status", _user.status);
            return(await reposGen.ExecuteNonQuery_Async("users_Insert_Update", param));
        }
Пример #29
0
        public ActionResult Detail(string EmployeeId)
        {
            var data  = _employeeBLL.GetByID(EmployeeId);
            var model = new EmployeeItem();

            model              = Mapper.Map <EmployeeItem>(data);
            model              = listdata(model, model.CITY);
            model.MainMenu     = _mainMenu;
            model.CurrentLogin = CurrentUser;
            return(View(model));
        }
Пример #30
0
        public ViewEmployeeDetails(EmployeeItem empItem)
        {
            InitializeComponent();

            displayDetails(empItem);

            mEmpItem = empItem;

            cbPosition.ItemsSource  = StaticPositionCollection.staticPositionList;
            cbEmpStatus.ItemsSource = Enum.GetValues(typeof(EmployeeStatus)).Cast <EmployeeStatus>();
        }
Пример #31
0
		public ScheduleSelectionViewModel(Employee employee, EmployeeItem employeeSchedule, DateTime startDate)
		{
			Title = "Выбор графика работы";
			Employee = employee;
			StartDate = startDate;

			Schedules = new ObservableCollection<Schedule>();
			var schedules = ScheduleHelper.GetByOrganisation(Employee.OrganisationUID);
			if (schedules != null)
			{
				foreach (var schedule in schedules)
				{
					Schedules.Add(schedule);
				}
			}
			if (employeeSchedule != null)
			{
				SelectedSchedule = Schedules.FirstOrDefault(x => x.UID == employeeSchedule.UID);
			}
		}
Пример #32
0
		public PositionSelectionViewModel(Employee employee, EmployeeItem employeePosition)
		{
			Title = "Выбор должности";
			OrganisationUID = employee.OrganisationUID;
			AddCommand = new RelayCommand(OnAdd, CanAdd);
			ClearCommand = new RelayCommand(OnClear);

			Positions = new ObservableCollection<ShortPosition>();
			var positions = PositionHelper.GetByOrganisation(OrganisationUID);
			if (positions != null)
			{
				foreach (var position in positions)
				{
					Positions.Add(position);
				}
			}
			if (employeePosition != null)
			{
				SelectedPosition = Positions.FirstOrDefault(x => x.UID == employeePosition.UID);
			}
		}
Пример #33
0
		public EscortSelectionViewModel(EmployeeItem department, ShortEmployee shortEmployee, Guid organisationUID)
		{
			Title = "Сопровождающий";
			var filter = new EmployeeFilter();
			if(EmployeeItem.IsNotNullOrEmpty(department))
				filter.DepartmentUIDs.Add(department.UID);
			filter.OrganisationUIDs.Add(organisationUID);

			Employees = new List<ShortEmployee>();
			var employees = EmployeeHelper.Get(filter);
			if (employees != null)
			{
				foreach (var employee in employees)
				{
					Employees.Add(employee);
				}
			}

			if (shortEmployee != null)
			{
				SelectedEmployee = Employees.FirstOrDefault(x => x.UID == shortEmployee.UID);
			}
		}