/// <summary>
        /// 新增
        /// </summary>
        public void ExecutEvent(object source, EventArgs e)
        {
            _ItsView.ResultMessage = string.Empty;

            if (!new EmployeeValidater(_ItsView).Validation())
            {
                return;
            }

            Account account = new EmployeeDataCollector(_ItsView).AccountDataCollect();

            try
            {
                using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required))
                {
                    BllInstance.AccountBllInstance.CreateAccount(account, LoginUser);
                    if (CompanyConfig.HasHrmisSystem && account.IsHRAccount)
                    {
                        IEmployeeFacade hrmisEmployeeFacade =
                            new EmployeeFacade();
                        hrmisEmployeeFacade.InitEmployeeProxy(account.Id, LoginUser);
                    }
                    ts.Complete();
                }
                GoToListPage();
            }
            catch (Exception ex)
            {
                _ItsView.ResultMessage =
                    //"&nbsp;&nbsp;&nbsp;<img src='../../image/icon03.jpg' align='absmiddle'' />&nbsp;&nbsp;&nbsp;<span class='fontred'>" +
                    ex.Message;// +"</span>";
            }
        }
        public async Task <ActionResult> Delete(int id)
        {
            await EmployeeFacade.Delete(id);

            List <EmployeeDto> employees = await CompanyFacade.GetAllEmployees(User.Identity.Name);

            return(View("Employees", employees));
        }
 private void RetrieveData()
 {
     using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CRMDataStoreKey))
     {
         EmployeeFacade facade = new EmployeeFacade(uow);
         RetrieveInstances(facade);
     }
 }
Beispiel #4
0
        public Stream GetSlcEmployee(Core.Model.mdlBranchParam param)
        {
            string json = Core.Services.RestPublisher.Serialize(EmployeeFacade.getSlcEmployee(param.BranchID));

            WebOperationContext.Current.OutgoingResponse.ContentType = "application/json; charset=utf-8";
            MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(json));

            return(ms);
        }
Beispiel #5
0
        public Stream GetEmployee()
        {
            string json = Core.Services.RestPublisher.Serialize(EmployeeFacade.LoadEmployee2());

            WebOperationContext.Current.OutgoingResponse.ContentType = "application/json; charset=utf-8";
            MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(json));

            return(ms);
        }
Beispiel #6
0
        public static void Process()
        {
            Console.Write("Enter employee Id");
            var employeeId = Console.ReadLine();

            var total = new EmployeeFacade().GetTotalIncomeEmployee(employeeId);

            Console.WriteLine("Total income employee {0} , {1}", employeeId, total);
            Console.ReadLine();
        }
Beispiel #7
0
 private void RetrieveData()
 {
     using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CRMDataStoreKey))
     {
         EmployeeFacade facade   = new EmployeeFacade(uow);
         EmployeeDto    instance = facade.RetrieveOrNewEmployee(InstanceId, new EmployeeConverter());
         CurrentInstance         = instance;
         ucIEdit.CurrentInstance = instance;
     }
 }
Beispiel #8
0
        public ActionResult GetEmployees()
        {
            EmployeeFacade facade  = new EmployeeFacade();
            var            employe = facade.GetEmployees();
            var            data    = new
            {
                total = employe
            };

            return(Json(data, JsonRequestBehavior.AllowGet));
        }
 private void RetrieveInstances(EmployeeFacade facade)
 {
     if (CurrentUserContext.IsAdmin)
     {
         CurrentInstances = facade.RetrieveAllEmployee(new EmployeeConverter());
     }
     else if (CurrentUserContext.IsEmployee)
     {
         List <EmployeeDto> instances = new List <EmployeeDto>();
         EmployeeDto        instance  = facade.RetrieveOrNewEmployee(CurrentUserContext.User.MatchId, new EmployeeConverter());
         instances.Add(instance);
         CurrentInstances = instances;
     }
 }
        public async Task <ActionResult> Save(EmployeeDto employee)
        {
            try
            {
                employee.CompanyId = await GetCurrentCompanyId();

                await EmployeeFacade.Update(employee);

                return(RedirectToAction("Employees"));
            }
            catch (Exception)
            {
                return(View("Edit", employee));
            }
        }
 private static bool HasUsing(int id)
 {
     if (MasterPagePresenter.HasHrmisSystem)
     {
         IEmployeeFacade iEmployeeFacade = new EmployeeFacade();
         List <Employee> employeeList    = iEmployeeFacade.GetAllEmployeeBasicInfoWithOutLoadAccount();
         foreach (Employee employee in employeeList)
         {
             if (employee.Account != null && employee.Account.Position != null &&
                 employee.Account.Position.Grade != null)
             {
                 if (employee.Account.Position.Grade.Id == id)
                 {
                     return(true);
                 }
             }
         }
     }
     return(false);
 }
Beispiel #12
0
        static void Main(string[] args)
        {
            var employee = new Employee()
            {
                Age  = 20,
                Name = "Denis Petroff"
            };

            var employeeFacade = new EmployeeFacade(employee);

            /**
             * Используем ExtraPayCalulator для расчета зарплаты на часах при переработке
             */
            employeeFacade.GetPay();

            /**
             * Используем RegularReporter для создания отчетов на обязательных часах
             */
            employeeFacade.GetReport();
        }
        protected void ucIList_InstanceRowDeleting(object sender, InstanceRowDeletingEventArgs e)
        {
            using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CRMDataStoreKey))
            {
                EmployeeFacade facade = new EmployeeFacade(uow);
                IFacadeUpdateResult <EmployeeData> result = facade.DeleteEmployee(e.Instance.Id);
                e.IsSuccessful = result.IsSuccessful;

                if (result.IsSuccessful)
                {
                    // Refresh whole list
                    RetrieveInstances(facade);
                }
                else
                {
                    // Deal with Update result
                    ProcUpdateResult(result.ValidationResult, result.Exception);
                }
            }
        }
Beispiel #14
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         using (OpenFileDialog op = new OpenFileDialog()
         {
             Filter = "CSV|*.csv", ValidateNames = true, Multiselect = false
         })
         {
             if (op.ShowDialog() == DialogResult.OK)
             {
                 EmployeeFacade.LoadAndStoreEmployeeFromCsv(op.FileName);
                 MessageBox.Show("Data Successfully Saved into Temporary Database.");
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Beispiel #15
0
        protected void ucIEdit_InstanceSaving(object sender, InstanceSavingEventArgs e)
        {
            EmployeeDto instance = e.Instance as EmployeeDto;

            if (instance != null)
            {
                using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CRMDataStoreKey))
                {
                    EmployeeFacade facade = new EmployeeFacade(uow);
                    IFacadeUpdateResult <EmployeeData> result = facade.SaveEmployee(instance);
                    e.IsSuccessful = result.IsSuccessful;
                    if (result.IsSuccessful)
                    {
                        // Refresh Instance
                        CurrentInstance = result.ToDto <EmployeeDto>(new EmployeeConverter());
                    }
                    else
                    {
                        // Deal with Update result
                        ProcUpdateResult(result.ValidationResult, result.Exception);
                    }
                }
            }
        }
Beispiel #16
0
 public EmployeeController()
 {
     this.empFac = new EmployeeFacade();
 }
        public IHttpActionResult AddEmployee([FromBody] ZBUserDetails newEmployee)
        {
            MbsResult retVal = EmployeeFacade.AddEmployee(newEmployee);

            return(Ok(retVal));
        }
        public IHttpActionResult AuthenticateEmployee([FromBody] ZBUserDetails employee)
        {
            MbsResult retVal = EmployeeFacade.AuthenticateEmployee(employee);

            return(Ok(retVal));
        }
        public IHttpActionResult GetEmployeeList()
        {
            MbsResult retVal = EmployeeFacade.GetEmployeeList();

            return(Ok(retVal));
        }
Beispiel #20
0
 public EmployeeController()
 {
     employeeService = new EmployeeFacade();
 }
 public async Task <EmployeeDto> GetEmployee(int id)
 {
     return(await EmployeeFacade.GetAsync(id));
 }
 public async Task <EmployeeDto> GetEmployee(string email)
 {
     return(await EmployeeFacade.GetAsyncByEmail(email));
 }
Beispiel #23
0
 public Core.Model.mdlResultSvc UploadEmployee(Core.Model.mdlEmployeeParam param)
 {
     return(EmployeeFacade.UploadEmployee(param));
 }
Beispiel #24
0
 public Core.Model.mdlResultSvc DeleteEmployee(Core.Model.mdlEmployeeParam param)
 {
     return(EmployeeFacade.DeleteEmployee(param.EmployeeID));
 }
        public IHttpActionResult GetEmployeeDetails(string internalEmployeeId)
        {
            MbsResult retVal = EmployeeFacade.GetEmployeeDetails(internalEmployeeId);

            return(Ok(retVal));
        }
        public IHttpActionResult UpdateEmployee([FromBody] ZBUserDetails updateEmployee)
        {
            MbsResult retVal = EmployeeFacade.UpdateEmployee(updateEmployee);

            return(Ok(retVal));
        }
        public IHttpActionResult AddEmployeeTask([FromBody] List <ZbWorks> Newtask)
        {
            MbsResult retVal = EmployeeFacade.AddEmployeeTask(Newtask);

            return(Ok(retVal));
        }
        public IHttpActionResult GetEmployeeWorksheetDetailsByDate(string internalEmployeeId, long TaskDate, long TaskDate2)
        {
            MbsResult retVal = EmployeeFacade.GetEmployeeWorksheetDetailsByDate(internalEmployeeId, TaskDate, TaskDate2);

            return(Ok(retVal));
        }
        public async Task <ActionResult> Edit(int id)
        {
            EmployeeDto employee = await EmployeeFacade.GetAsync(id);

            return(View(employee));
        }