Ejemplo n.º 1
0
        public ActionResult ProfileRecord(int EmployeeId)
        {
            int userId = SessionProxy.UserId;
            MainResoureViewModel model = _EmployeeProfileMethod.EmployeeProfileGetByID(EmployeeId, userId);

            return(PartialView("_PartialProfileUpdaterecord", model));
        }
        public ActionResult Index(int EmployeeId)
        {
            MainResoureViewModel model = new MainResoureViewModel();

            model.Id = EmployeeId;
            return(View(model));
        }
Ejemplo n.º 3
0
        public ActionResult UpdateProfile(MainResoureViewModel model)
        {
            int userId = SessionProxy.UserId;

            _EmployeeProfileMethod.SaveProfileSet(model);
            model = _EmployeeProfileMethod.EmployeeProfileGetByID(model.Id, userId);
            return(PartialView("_PartialProfileUpdaterecord", model));
        }
Ejemplo n.º 4
0
        public void DeleteWorkerRecord(int Id, int Users)
        {
            MainResoureViewModel model   = new MainResoureViewModel();
            AspNetUser           _skills = _db.AspNetUsers.Where(x => x.Id == Id).FirstOrDefault();

            _skills.Archived         = true;
            _skills.LastModifiedDate = DateTime.Now;
            _skills.CreatedBy        = Users;
            _db.SaveChanges();
        }
Ejemplo n.º 5
0
        public ActionResult CustomerCare()
        {
            //  var data = _EmployeeMethod.BindWorkerDropdown();
            MainResoureViewModel model = new MainResoureViewModel();

            var List = _db.AspNetUsers.Where(x => x.SSOID.Contains("W") && x.Archived == false).ToList();

            //model.Add("-- Select User --");
            //foreach (var item in List)
            //{
            //    var value = String.Format("{0} {1} - {2}", item.FirstName, item.LastName, item.SSOID);
            //    model.Add(value);
            //}
            foreach (var item in List)
            {
                model.EmployeeCustomerCare.Add(new SelectListItem()
                {
                    Text = item.FirstName + item.LastName + "-" + item.SSOID, Value = item.Id.ToString()
                });
            }
            return(Json(List, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 6
0
        public int SaveCoustomertSet(MainResoureViewModel model)
        {
            //AspNetUser AddUser = _db.AspNetUsers.Where(x => x.Id == model.Id).FirstOrDefault();
            AspNetUser AddUser = new AspNetUser();

            //step 1
            AddUser.NameTitle    = model.Title;
            AddUser.FirstName    = model.FirstName;
            AddUser.LastName     = model.LastName;
            AddUser.OtherNames   = model.OtherNames;
            AddUser.KnownAs      = model.KnownAs;
            AddUser.SSOID        = model.SSO;
            AddUser.UserName     = model.UserNameEmail;
            AddUser.IMAddress    = model.IMAddress;
            AddUser.Gender       = model.Gender;
            AddUser.image        = model.Picture;
            AddUser.PasswordHash = model.PasswordHash;
            AddUser.CreatedDate  = DateTime.Now;
            if (model.DateOfBirth != null)
            {
                var DateOfBirthToString = DateTime.ParseExact(model.DateOfBirth, inputFormat, CultureInfo.InvariantCulture);
                AddUser.DateOfBirth = Convert.ToDateTime(DateOfBirthToString.ToString(outputFormat));
            }
            AddUser.JobTitle                = model.JobTitle;
            AddUser.WorkPhone               = model.WorkPhone;
            AddUser.WorkMobile              = model.WorkMobile;
            AddUser.Archived                = false;
            AddUser.CreatedBy               = SessionProxy.UserId;
            AddUser.CreatedDate             = DateTime.Now;
            AddUser.CustomerCareID          = model.CustomerCareId;
            AddUser.SelectCustomerCompanyId = model.SelectCustomerCompanyId;
            _db.AspNetUsers.Add(AddUser);
            _db.SaveChanges();

            return(AddUser.Id);
        }
        public ActionResult getEmployeeData(int Id)
        {
            int userId           = SessionProxy.UserId;
            var Employee         = _db.AspNetUsers.Where(x => x.Id == Id).FirstOrDefault();
            var EmployeeRelation = _db.EmployeeRelations.Where(x => x.UserID == Employee.Id && x.IsActive == true).FirstOrDefault();
            AdminPearformanceMethod _AdminPearformanceMethod = new AdminPearformanceMethod();
            MainResoureViewModel    model = new MainResoureViewModel();
            List <AspNetUser>       data  = _AdminPearformanceMethod.getAllUserList().ToList();

            //model.ReportstoList.Add(new SelectListItem() { Text = "--Select--", Value = "0" });
            //model.AdditionalReportstoList.Add(new SelectListItem() { Text = "--Select--", Value = "0" });
            //model.HRResponsibleList.Add(new SelectListItem() { Text = "--Select--", Value = "0" });
            //var User = data.Where(x => x.Id == EmployeeRelation.Reportsto).FirstOrDefault();
            //model.RepoempName = User.FirstName + " " + User.LastName + "-" + User.SSOID;
            //var AddRepoName = data.Where(xx => xx.Id == Employee.AdditionalReportsto).FirstOrDefault();
            //model.AddReName = AddRepoName.FirstName + " " + AddRepoName.LastName + " " + AddRepoName.SSOID;
            //var HRRepoName= data.Where(xx => xx.Id == Employee.HRResponsible).FirstOrDefault();
            //model.HRResponsibleName = HRRepoName.FirstName + " " + HRRepoName.LastName + "-" + HRRepoName.SSOID;

            foreach (var item in data)
            {
                string Name = string.Format("{0} {1}-{2}", item.FirstName, item.LastName, item.SSOID);
                if ((EmployeeRelation != null ? EmployeeRelation.Reportsto : 0) == item.Id)
                {
                    model.ReportstoList.Add(new SelectListItem()
                    {
                        Text = Name, Value = @item.Id.ToString(), Selected = true
                    });
                }
                else
                {
                    if (Employee.Id != item.Id)
                    {
                        model.ReportstoList.Add(new SelectListItem()
                        {
                            Text = Name, Value = @item.Id.ToString()
                        });
                    }
                }
                if (Employee.AdditionalReportsto == item.Id)
                {
                    model.AdditionalReportstoList.Add(new SelectListItem()
                    {
                        Text = Name, Value = @item.Id.ToString(), Selected = true
                    });
                }
                else
                {
                    if (Employee.Id != item.Id)
                    {
                        model.AdditionalReportstoList.Add(new SelectListItem()
                        {
                            Text = Name, Value = @item.Id.ToString()
                        });
                    }
                }

                if (Employee.HRResponsible == item.Id)
                {
                    model.HRResponsibleList.Add(new SelectListItem()
                    {
                        Text = Name, Value = @item.Id.ToString(), Selected = true
                    });
                }
                else
                {
                    if (Employee.Id != item.Id)
                    {
                        model.HRResponsibleList.Add(new SelectListItem()
                        {
                            Text = Name, Value = @item.Id.ToString()
                        });
                    }
                }
            }
            var List = _db.AspNetUsers.Where(x => x.SSOID.Contains("W") && x.Archived == false).ToList();

            foreach (var item in List)
            {
                model.EmployeeCustomerCare.Add(new SelectListItem()
                {
                    Text = item.FirstName + item.LastName + "-" + item.SSOID, Value = item.Id.ToString()
                });
            }
            return(Json(model, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 8
0
        public int SaveResourcetSet(MainResoureViewModel model)
        {
            //AspNetUser AddUser = _db.AspNetUsers.Where(x => x.Id == model.Id).FirstOrDefault();
            AspNetUser AddUser = new AspNetUser();

            //step 1
            AddUser.NameTitle    = model.Title;
            AddUser.FirstName    = model.FirstName;
            AddUser.LastName     = model.LastName;
            AddUser.OtherNames   = model.OtherNames;
            AddUser.KnownAs      = model.KnownAs;
            AddUser.SSOID        = model.SSO.ToUpper();
            AddUser.UserName     = model.UserNameEmail;
            AddUser.IMAddress    = model.IMAddress;
            AddUser.Gender       = model.Gender;
            AddUser.Archived     = false;
            AddUser.PasswordHash = model.PasswordHash;
            AddUser.CreatedDate  = DateTime.Now;
            AddUser.CreatedBy    = SessionProxy.UserId;
            if (model.DateOfBirth != null)
            {
                var DateOfBirthToString = DateTime.ParseExact(model.DateOfBirth, inputFormat, CultureInfo.InvariantCulture);
                AddUser.DateOfBirth = Convert.ToDateTime(DateOfBirthToString.ToString(outputFormat));
            }
            AddUser.Nationality     = model.Nationality;
            AddUser.NINumberSSN     = model.NIN_SSN;
            AddUser.image           = model.Picture;
            AddUser.IsReadAddReport = false;
            AddUser.IsReadArchived  = false;
            AddUser.IsReadHRRespo   = false;

            //Step 2
            if (model.StartDate != null)
            {
                var StartDateToString = DateTime.ParseExact(model.StartDate, inputFormat, CultureInfo.InvariantCulture);
                AddUser.StartDate = Convert.ToDateTime(StartDateToString.ToString(outputFormat));
            }
            AddUser.ResourceType = model.ResourceType;
            //AddUser.Reportsto = model.Reportsto;
            AddUser.AdditionalReportsto = model.AdditionalReportsto;
            AddUser.HRResponsible       = model.HRResponsible;
            AddUser.JobTitle            = model.JobTitle;
            AddUser.JobContryID         = model.JobCountrID;
            AddUser.Location            = model.Location;
            //AddUser.BusinessID = model.BusinessID;
            //AddUser.DivisionID = model.DivisionID;
            //AddUser.PoolID = model.PoolID;
            //AddUser.FunctionID = model.FunctionID;

            //step 3
            if (model.ProbationEndDate != null)
            {
                var ProbationEndDateToString = DateTime.ParseExact(model.ProbationEndDate, inputFormat, CultureInfo.InvariantCulture);
                AddUser.ProbationEndDate = Convert.ToDateTime(ProbationEndDateToString.ToString(outputFormat));
            }
            if (model.NextProbationReviewDate != null)
            {
                var NextProbationReviewDateToString = DateTime.ParseExact(model.NextProbationReviewDate, inputFormat, CultureInfo.InvariantCulture);
                AddUser.ProbationEndDate = Convert.ToDateTime(NextProbationReviewDateToString.ToString(outputFormat));
            }
            if (model.FixedTermEndDate != null)
            {
                var FixedTermEndDateToString = DateTime.ParseExact(model.FixedTermEndDate, inputFormat, CultureInfo.InvariantCulture);
                AddUser.FixedTermEndDate = Convert.ToDateTime(FixedTermEndDateToString.ToString(outputFormat));
            }
            AddUser.NoticePeriod             = model.NoticePeriodID;
            AddUser.MethodofRecruitmentSetup = model.MethodofRecruitmentSetup;
            AddUser.RecruitmentCost          = model.RecruitmentCost.ToString();
            // AddUser.CurrenciesId = model.curruncyID;
            if (model.HolidaysThisYear != null)
            {
                AddUser.Thisyear = (int)model.HolidaysThisYear;
            }
            if (model.HolidaysNextYear != null)
            {
                AddUser.Nextyear = (int)model.HolidaysNextYear;
            }
            if (model.IncludePublicHoliday != null)
            {
                if (model.IncludePublicHoliday == "on")
                {
                    AddUser.IncludePublicHoliday = true;
                }
                else
                {
                    AddUser.IncludePublicHoliday = false;
                }
            }
            if (model.HolidayEntit != 0 && model.HolidayEntit != null)
            {
                AddUser.HolidayEntitlement = model.HolidayEntit;
            }
            //step 4
            //AddUser.Country = model.CountryId;
            //AddUser.State = model.StateId;
            //AddUser.Town = model.CityyId;
            //AddUser.Airport = model.AirportId;
            //AddUser.Postcode = model.PostalCode;
            //AddUser.BankAddress = model.Address;
            AddUser.WorkPhone  = model.WorkPhone;
            AddUser.WorkMobile = model.WorkMobile;
            //AddUser.PersonalPhone = model.PersonalPhone;
            //AddUser.PersonalMobile = model.PersonalMobile;
            //AddUser.PersonalEmail = model.PersonalEmail;
            //AddUser.BankName = model.BankName;
            //AddUser.BankCode = model.BankCode;
            //AddUser.AccountNumber = model.AccountNumber;
            //AddUser.OtherAccountInformation = model.OtherAccountInformation;
            //AddUser.AccountName = model.AccountName;
            //AddUser.BankAddress = model.BankAddress;
            AddUser.CreatedBy = model.CurrentUserId;

            //Step 5
            JavaScriptSerializer         js             = new JavaScriptSerializer();
            List <AddnewtaskRecordmodel> listValueArray = js.Deserialize <List <AddnewtaskRecordmodel> >(model.JsonNewtaskList);

            foreach (var item in listValueArray)
            {
                Task_List ModelNew = new Task_List();
                ModelNew.InRelationTo    = model.Id;
                ModelNew.Title           = item.Title;
                ModelNew.Description     = item.Description;
                ModelNew.AssignTo        = item.Assign;
                ModelNew.Archived        = false;
                ModelNew.AlterBeforeDays = item.AlertBeforeDays;
                if (item.DueDate != "")
                {
                    var DueDateToString = DateTime.ParseExact(item.DueDate, inputFormat, CultureInfo.InvariantCulture);
                    ModelNew.DueDate = Convert.ToDateTime(DueDateToString.ToString(outputFormat));
                }
                ModelNew.Status       = item.Status;
                ModelNew.LastModified = DateTime.Now;
                ModelNew.Created      = DateTime.Now;
                _db.Task_List.Add(ModelNew);
            }
            _db.AspNetUsers.Add(AddUser);
            _db.SaveChanges();


            if (AddUser.Id > 0)
            {
                //Employee Relation
                EmployeeRelation _employeeRelation = new EmployeeRelation();
                _employeeRelation.UserID = AddUser.Id;
                if (model.Reportsto != null)
                {
                    _employeeRelation.Reportsto = model.Reportsto.Value;
                }
                _employeeRelation.BusinessID  = model.BusinessID;
                _employeeRelation.DivisionID  = model.DivisionID;
                _employeeRelation.PoolID      = model.PoolID;
                _employeeRelation.FunctionID  = model.FunctionID;
                _employeeRelation.CreateBy    = model.CurrentUserId;
                _employeeRelation.CreatedDate = DateTime.Now;
                _employeeRelation.IsActive    = true;
                _db.EmployeeRelations.Add(_employeeRelation);

                //Employee Address Info
                EmployeeAddressInfo _EmployeeAddressInfo = new EmployeeAddressInfo();
                _EmployeeAddressInfo.UserId         = AddUser.Id;
                _EmployeeAddressInfo.CountryId      = model.CountryId;
                _EmployeeAddressInfo.StateId        = model.StateId;
                _EmployeeAddressInfo.TownId         = model.CityyId;
                _EmployeeAddressInfo.AirportId      = model.AirportId;
                _EmployeeAddressInfo.PostCode       = model.PostalCode;
                _EmployeeAddressInfo.ContactAddress = model.Address;
                _EmployeeAddressInfo.PersonalPhone  = model.PersonalPhone;
                _EmployeeAddressInfo.PersonalMobile = model.PersonalMobile;
                _EmployeeAddressInfo.PersonalEmail  = model.PersonalEmail;
                _db.EmployeeAddressInfoes.Add(_EmployeeAddressInfo);

                EmployeeBankInfo _EmployeeBankInfo = new EmployeeBankInfo();
                _EmployeeBankInfo.UserId                  = AddUser.Id;
                _EmployeeBankInfo.BankName                = model.BankName;
                _EmployeeBankInfo.BankCode                = model.BankCode;
                _EmployeeBankInfo.AccountName             = model.AccountName;
                _EmployeeBankInfo.AccountNumber           = model.AccountNumber;
                _EmployeeBankInfo.OtherAccountInformation = model.OtherAccountInformation;
                _EmployeeBankInfo.BankAddress             = model.BankAddress;
                _EmployeeBankInfo.IBAN_No                 = model.IBAN_Number;
                _EmployeeBankInfo.SWIFT_Code              = model.SWIFT_Code;
                _db.EmployeeBankInfoes.Add(_EmployeeBankInfo);
            }

            if (model.ApplicantID != 0 && model.ApplicantID != null)
            {
                var AccepteID = _AdminTMSMethod.GetAcceptedStepId((int)model.ApplicantID);
                var data      = _db.TMS_Applicant.Where(x => x.Id == model.ApplicantID).FirstOrDefault();
                data.Archived     = true;
                data.StatusID     = AccepteID;
                data.LastModified = DateTime.Now;
            }
            _db.SaveChanges();
            return(AddUser.Id);
        }