Пример #1
0
        public ActionResult Edit(EmployeeViewModel employeeVM)
        {
            EmployeeClient empClient = new EmployeeClient();

            empClient.UpdateEmployee(employeeVM.Employee);
            return(RedirectToAction("Index"));
        }
Пример #2
0
 public void Authenticate()
 {
     ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => true;
     var auth    = new AuthClient(new Uri("https://intern.dev.bekk.no/autentiseringservice/"), "0", "0");
     var eClient = new EmployeeClient(auth);
     var x       = eClient.GetAll();
 }
Пример #3
0
        // GET: Employee
        public ActionResult Index()
        {
            EmployeeClient empClient = new EmployeeClient();

            ViewData["employees"] = empClient.GetEmployees();
            return(View());
        }
        public EmployeeSchedulerPage(UnicontaBaseEntity master)
            : base(master)
        {
            InitializeComponent();
            this.DataContext         = this;
            MainControl              = employeeScheduler;
            ribbonControl            = frmRibbon;
            frmRibbon.OnItemClicked += frmRibbon_OnItemClicked;
            employeeScheduler.AppointmentWindowShowing += EmployeeScheduler_AppointmentWindowShowing;
            employeeScheduler.ItemPropertyChanged      += EmployeeScheduler_ItemPropertyChanged;
            employeeScheduler.Loaded                       += EmployeeScheduler_Loaded;
            employeeScheduler.InitNewAppointment           += EmployeeScheduler_InitNewAppointment;
            employeeScheduler.AppointmentDrop              += EmployeeScheduler_AppointmentDrop;
            employeeScheduler.AppointmentResize            += EmployeeScheduler_AppointmentResize;
            employeeScheduler.AllowAppointmentEdit          = true;
            employeeScheduler.AllowAppointmentDelete        = true;
            employeeScheduler.AllowInplaceEditor            = true;
            employeeScheduler.CustomAllowAppointmentEdit   += EmployeeScheduler_CustomAllowAppointmentEdit;
            employeeScheduler.CustomAllowInplaceEditor     += EmployeeScheduler_CustomAllowInplaceEditor;
            employeeScheduler.CustomAllowAppointmentDelete += EmployeeScheduler_CustomAllowAppointmentDelete;
            employeeScheduler.TaskDataType                  = master.GetType();
            RemoveMenuItem();

            if (master != null)
            {
                Employee    = master as EmployeeClient;
                _employee   = Employee.Number;
                _masterList = new List <UnicontaBaseEntity>();
                _masterList.Add(master);
                GetMappings();
            }
        }
Пример #5
0
 public OrderController()
 {
     _productClient  = new ProductClient();
     _employeeClient = new EmployeeClient();
     _orderClient    = new OrderClient();
     _customerClient = new CustomerClient();
 }
Пример #6
0
        public ActionResult Delete(int empCode)
        {
            EmployeeClient empClient = new EmployeeClient();

            empClient.DeleteEmployeeByEmpCode(empCode);
            return(RedirectToAction("Index"));
        }
Пример #7
0
        public ActionResult AddNewEmployee()
        {
            EmployeeProfile profile = new EmployeeProfile();

            if (this.IsAuthorized == "NoAuth")
            {
                Response.Redirect("~/Home/Unauthorized");
                return(null);
            }
            else
            {
                using (var client = new OfficeLocationClient())
                {
                    var          lstOfc = client.GetAllOfficeLocations();
                    DropDownItem di     = new DropDownItem();
                    ViewBag.EmpOffice = lstOfc.Where(x => x.Key == Convert.ToString(OfficeId)).ToList();
                    di.Key            = "";
                    di.Value          = "";
                    lstOfc.Insert(0, di);
                    ViewBag.OfficeLocationList = lstOfc;
                }
                using (var client = new RoleClient())
                {
                    ViewBag.RoleList = client.GetAllRoles();
                }
                using (var client = new ShiftClient())
                {
                    ViewBag.ShiftList = client.GetShiftMaster();
                }
                using (var client = new EmployeeClient())
                {
                    IList <DropDownItem> reptList = client.GetActiveEmpList(OfficeId, null);
                    DropDownItem         di       = new DropDownItem
                    {
                        Key   = "",
                        Value = ""
                    };
                    reptList.Insert(0, di);
                    ViewBag.ReportToList = reptList;
                }
                profile.EmploymentTypeId = 1;
                using (var client = new EmployeeClient())
                {
                    var          lstEmploymentTypes = client.GetEmploymentTypes();
                    DropDownItem di = new DropDownItem();
                    ViewBag.EmploymentTypeList = lstEmploymentTypes;
                }
                using (var client = new EmployeeClient())
                {
                    profile.EmployeeId = client.GetNewEmpId(OfficeId, profile.EmploymentTypeId);
                }
                profile.IsActive = true;
                profile.Mode     = "Add";
                profile.LogonId  = "CORP\\";
                profile.Sunday   = true;
                profile.Saturday = true;
                return(View("EmployeeProfile", profile));
            }
        }
Пример #8
0
 public ActionResult GetReportToList(Int64 LocationId)
 {
     using (var client = new EmployeeClient())
     {
         var ReportToList = client.GetReportToList(LocationId);
         return(Json(ReportToList));
     }
 }
Пример #9
0
        public Funcionario_Page()
        {
            InitializeComponent();

            _client = new EmployeeClient(new HttpClient());

            LoadEmployees();
        }
Пример #10
0
        public ActionResult Edit(int empCode)
        {
            EmployeeClient    empClient  = new EmployeeClient();
            EmployeeViewModel employeeVM = new EmployeeViewModel();

            employeeVM.Employee = empClient.GetEmployeeByEmpCode(empCode);
            return(View("Edit", employeeVM));
        }
Пример #11
0
        private void CopyRecord(EmployeeClient selectedItem)
        {
            var emp = Activator.CreateInstance(selectedItem.GetType()) as EmployeeClient;

            CorasauDataGrid.CopyAndClearRowId(selectedItem, emp);
            string header = string.Format(Uniconta.ClientTools.Localization.lookup("CopyOBJ"), selectedItem._Name);

            AddDockItem(TabControls.EmployeePage2, new object[] { emp, false }, header);
        }
Пример #12
0
        public IList <LeaveCreditModel> GetEmployeeCLSLData(long leaveTypeId)
        {
            IList <LeaveCreditModel> lstProfile = new List <LeaveCreditModel>();

            using (var client = new EmployeeClient())
            {
                lstProfile = client.GetEmployeeProfilesforCLSL(leaveTypeId);
            }
            return(lstProfile);
        }
Пример #13
0
        public void GetEmployees_NoEmployees_ExpectEmptyList()
        {
            HttpClient httpClient = HttpClientMockHelper.GetMockedHttpClient("[]");

            var employeeClient = new EmployeeClient(httpClient);

            var result = employeeClient.GetEmployees();

            Assert.Empty(result);
        }
        public Inscricao_Page()
        {
            InitializeComponent();

            _courseClient       = new CourseClient(new HttpClient());
            _employeeClient     = new EmployeeClient(new HttpClient());
            _subscriptionClient = new SubscriptionClient(new HttpClient());

            Load();
        }
Пример #15
0
        public string GetNewEmpId(long employmentTypeId)
        {
            string newempId = string.Empty;

            using (var client = new EmployeeClient())
            {
                newempId = client.GetNewEmpId(OfficeId, employmentTypeId);
            }
            return(newempId);
        }
Пример #16
0
 /*For Edit*/
 public EmployeePage2(UnicontaBaseEntity sourcedata, bool isEdit = true)
     : base(sourcedata, isEdit)
 {
     InitializeComponent();
     if (!isEdit)
     {
         editrow         = (EmployeeClient)StreamingManager.Clone(sourcedata);
         editrow._Number = null;
     }
     InitPage(api);
 }
Пример #17
0
        public ActionResult TeamProfileData(bool onlyReportedToMe, Int64?paramUserId, string requestMenuUser, bool hideInactiveEmp)
        {
            IList <ViewEmployeeProfileModel> lstProfile = new List <ViewEmployeeProfileModel>();

            using (var client = new EmployeeClient())
            {
                lstProfile = client.GetTeamProfiles(this.UserId, onlyReportedToMe, paramUserId, requestMenuUser, hideInactiveEmp);
            }

            return(PartialView("EmployeeLmsProfileNamesPartial", lstProfile));
        }
Пример #18
0
        public IList <LeaveCreditModel> GetEmployeeELData()
        {
            IList <LeaveCreditModel> lstProfile = new List <LeaveCreditModel>();
            DateTime lastCreditRun = GetlastCreditRunforEL();

            using (var client = new EmployeeClient())
            {
                lstProfile = client.GetEmployeeProfilesforEL(lastCreditRun);
            }
            return(lstProfile);
        }
Пример #19
0
        static void Main()
        {
            var thirdPartyEmployee = new ThirdPartyEmployee();
            var employeeTarget     = new EmployeeAdapter(thirdPartyEmployee);

            var client    = new EmployeeClient(employeeTarget);
            var employees = client.GetEmployees();

            client.RenderEmployees(employees);

            Console.ReadLine();
        }
Пример #20
0
        public void GetEmployees_TwoEmployees_ExpectTwoEmployees()
        {
            var employees = new List <EmployeeDto>()
            {
                { new EmployeeDto() }, { new EmployeeDto() }
            };

            HttpClient httpClient     = HttpClientMockHelper.GetMockedHttpClient(JsonConvert.SerializeObject(employees));
            var        employeeClient = new EmployeeClient(httpClient);

            var result = employeeClient.GetEmployees();

            Assert.NotEmpty(result);
            Assert.Equal(2, result.Count);
        }
Пример #21
0
 void InitPage(CrudAPI crudapi)
 {
     layoutControl = layoutItems;
     cmbDim1.api   = cmbDim2.api = cmbDim3.api = cmbDim4.api = cmbDim5.api = leEmpGroup.api = lePayrollCategory.api = leApprover.api = leApprover2.api = leWarehouse.api = crudapi;
     Utility.SetDimensions(crudapi, lbldim1, lbldim2, lbldim3, lbldim4, lbldim5, cmbDim1, cmbDim2, cmbDim3, cmbDim4, cmbDim5, usedim);
     if (LoadedRow == null && editrow == null)
     {
         frmRibbon.DisableButtons("Delete");
         editrow = CreateNew() as EmployeeClient;
         editrow.SetMaster(api.CompanyEntity);
     }
     layoutItems.DataContext  = editrow;
     frmRibbon.OnItemClicked += frmRibbon_OnItemClicked;
     editrow.PropertyChanged += Editrow_PropertyChanged;
 }
Пример #22
0
        static void Main(string[] args)
        {
            TraineeEmployeeClient.MyManager.EmployeeClient manager = new EmployeeClient();

            Console.WriteLine(manager.SalaryCalculator("1"));

            TraineeEmployeeClient.MyTrainee.EmployeeClient trainee = new MyTrainee.EmployeeClient();

            Console.WriteLine(trainee.SalaryCalculator("1"));

            //Console.WriteLine(SerializeOperations.XMLSerializeEmployee(emp));

            //Employee e =(Employee) SerializeOperations.XMLDeSerializeEmployee(SerializeOperations.XMLSerializeEmployee(emp),typeof(Employee));

            Console.ReadLine();
        }
Пример #23
0
        static void AddEmployeeClient(int employeeId, int clientId, DateTime attractingDateTime, int dealSum, int dealPercentage, DateTime dealDateTime)
        {
            EmployeeClient employeeClient = new EmployeeClient
            {
                EmployeeId     = employeeId,
                ClientId       = clientId,
                AttractingDate = attractingDateTime,
                DealSum        = dealSum,
                DealPercentage = dealPercentage,
                DealDate       = dealDateTime
            };

            var employeeClients = _context.EmployeeClients.Add(employeeClient);

            _context.SaveChanges();
        }
Пример #24
0
        public ActionResult loadLateAndEarlyRpt(string Name, string FromDate, string ToDate, bool IsLeaveOnly, bool OnlyReportedToMe, string reqUsr, bool DonotShowRejected)
        {
            List <TimeSheetModel> lateAndEarlyRpt = null;

            if (Name != "")
            {
                Name = Name.Replace("|", " ");
            }
            DateTime startDateFormatted = DateTime.Now;
            DateTime endDateFormatted   = DateTime.Now;

            if (FromDate != null)
            {
                if (FromDate.Trim() != "")
                {
                    startDateFormatted = DateTime.ParseExact(FromDate, "d-M-yyyy", CultureInfo.InvariantCulture);
                    endDateFormatted   = DateTime.ParseExact(ToDate, "d-M-yyyy", CultureInfo.InvariantCulture);
                }
            }

            if (FromDate == "" || ToDate == "")
            {
                startDateFormatted = System.DateTime.Now.Date;
                endDateFormatted   = System.DateTime.Now.Date;
            }

            ITimesheetHelper EmployeeAttendanceHelperObj = new TimesheetClient();

            if (!string.IsNullOrEmpty(Name))
            {
                IEmployeeHelper EmployeeHelper = new EmployeeClient();
                Int64           UserID         = EmployeeHelper.GetUserId(Name);

                if (UserID > 0)
                {
                    lateAndEarlyRpt = EmployeeAttendanceHelperObj.GetMyTimeSheet(UserID, startDateFormatted, endDateFormatted);
                }
            }
            else
            {
                lateAndEarlyRpt = EmployeeAttendanceHelperObj.GetMyTeamTimeSheet(this.UserId, startDateFormatted, endDateFormatted, OnlyReportedToMe);
            }
            return(PartialView("ShiftBasedLateAndEarlyRptPartial", lateAndEarlyRpt));
        }
Пример #25
0
        public ActionResult LoadAppyOnBehalf(DateTime?StartDate, DateTime?LeaveUpto)
        {
            ViewBag.PageTile = "Apply For Leave Others";
            var   request = new LeaveRequestModel();
            Int64 userId  = (Int64)TempData["ApplyForUserId"];

            request.UserId = userId;
            if (StartDate != null)
            {
                request.LeaveFrom = StartDate.Value;
            }
            else
            {
                request.NumberOfDays = 1;
                request.LeaveFrom    = System.DateTime.Now;
            }
            if (LeaveUpto != null)
            {
                request.LeaveUpto = LeaveUpto.Value;
            }
            else
            {
                request.LeaveUpto = System.DateTime.Now;
            }
            using (var Client = new LeaveClient())
            {
                var commonData = Client.ApplyLeaveCommonData(this.OfficeId, userId);
                request.lstLeaveTypes         = commonData.lstLeaveTypes;
                request.lstSummary            = commonData.lstSummary;
                request.WeekOffs              = commonData.WeekOffs;
                request.holidayDates          = commonData.holidayDates;
                request.TimebasedLeaveTypeIds = commonData.TimebasedLeaveTypeIds;
            }
            using (var Client = new EmployeeClient())
            {
                request.ReportingToName = Client.ReportingToName(userId);
            }

            request.ViewTitle      = "Apply Request For " + TempData["ApplyForName"].ToString();
            request.ApplyMode      = "Others";
            request.ApplyForUserId = userId;
            return(View("ApplyFor", request));
        }
Пример #26
0
        private void search_Click(object sender, RoutedEventArgs e)
        {
            EmployeeClient emp = new EmployeeClient();
            UserAuth       a   = emp.getEmployeeRowById(tb1.Text.Trim());

            if (a != null)
            {
                lb1.Content = "Record Found";
                tb2.Text    = a.uname;
                tb3.Text    = a.password;
            }
            else
            {
                lb1.Content = "No matching record";
                tb1.Text    = "";
                tb2.Text    = "";
                tb3.Text    = "";
            }
        }
 void InitPage(UnicontaBaseEntity master)
 {
     InitializeComponent();
     MainControl              = projBudgetPlanScheduler;
     ribbonControl            = frmRibbon;
     BusyIndicator            = busyIndicator;
     frmRibbon.OnItemClicked += FrmRibbon_OnItemClicked;
     projBudgetPlanScheduler.AllowAppointmentEdit   = false;
     projBudgetPlanScheduler.AllowAppointmentDelete = false;
     projBudgetPlanScheduler.AllowInplaceEditor     = false;
     projBudgetPlanScheduler.AllowAppointmentCopy   = false;
     if (master != null)
     {
         Employee = master as EmployeeClient;
     }
     GetMappings();
     BindScheduler();
     projBudgetPlanScheduler.Loaded           += ProjBudgetPlanScheduler_Loaded;
     projBudgetPlanScheduler.PopupMenuShowing += ProjBudgetPlanScheduler_PopupMenuShowing;
 }
Пример #28
0
        private void delete_Click(object sender, RoutedEventArgs e)
        {
            EmployeeClient emp = new EmployeeClient();
            bool           a   = emp.deleteEmployee(tb1.Text.Trim());

            if (a)
            {
                lb1.Content = "Deleted Successfully";
                tb1.Text    = "";
                tb2.Text    = "";
                tb3.Text    = "";
            }
            else
            {
                lb1.Content = "Failed to delete";
                tb1.Text    = "";
                tb2.Text    = "";
                tb3.Text    = "";
            }
        }
Пример #29
0
        private void insert_Click(object sender, RoutedEventArgs e)
        {
            EmployeeClient emp = new EmployeeClient();
            bool           a   = emp.insertEmployee(tb1.Text.Trim(), tb2.Text.Trim(), tb3.Text.Trim());

            if (a)
            {
                lb1.Content = "Inserted Successfully";
                tb1.Text    = "";
                tb2.Text    = "";
                tb3.Text    = "";
            }
            else
            {
                lb1.Content = "Failed to insert";
                tb1.Text    = "";
                tb2.Text    = "";
                tb3.Text    = "";
            }
        }
Пример #30
0
        public ActionResult ViewEmployeeProfile()
        {
            ViewBag.PageTile      = "Employee Profile";
            ViewBag.TagLine       = "";
            ViewBag.IsSelfProfile = true;
            Int64 userIdForProfile           = 0;
            ViewEmployeeProfileModel profile = null;

            if (TempData["UserId"] == null)
            {
                userIdForProfile = UserId;
            }
            else
            {
                userIdForProfile = Convert.ToInt64(TempData["UserId"].ToString());
            }
            using (var client = new EmployeeClient())
            {
                profile = client.ViewEmployeeProfile(userIdForProfile);
            }

            return(View("ViewEmployeeProfile", profile));
        }