Beispiel #1
0
        public JsonResult Index(EmployeeDetails e)
        {
            HttpCookie rxgoadmin = Request.Cookies["rxgoAdmin"];
            string     adminid   = rxgoadmin.Values["Hid"];

            try
            {
                Random r = new Random();
                var    x = r.Next(0, 1000000);
                string s = x.ToString("000000");

                e.Password = s;
                //e.HospitalId = adminid;
                //e.VoterId = Session["Voterid"].ToString();
                //e.PanId = Session["Panid"].ToString();
                //e.AadharId = Session["AadharId"].ToString();
                e.ProfilePic = Session["ProfilePic"].ToString();

                if (dl.InsertEmployee_Sp(e) > 0)
                {
                    TempData["MSG"] = "Data Saved Successfully.";
                    //if (dl.InsertEmployee_Sp(e) > 0)
                    //{
                    //    TempData["MSG"] = "Data Saved Successfully.";
                    //}
                }
            }
            catch (Exception ex)
            {
                TempData["MSG"] = "Something went wrong.";
                return(Json(new { data = "error" }, JsonRequestBehavior.AllowGet));
                //return RedirectToAction("Index", "Employee");
            }
            int response = 1;

            return(Json(response, JsonRequestBehavior.AllowGet));
        }
Beispiel #2
0
            public async Task <LoginDetailsVM> Handle(AddEmployeeCommand request, CancellationToken cancellationToken)
            {
                var _employeeDetails = new EmployeeDetails
                {
                    Firstname = request.Employee.Firstname,
                    Lastname  = request.Employee.Lastname,
                    Address   = request.Employee.Address,
                    Email     = request.Employee.Email,
                    Number    = request.Employee.Number,
                    Role      = request.Employee.Role
                };

                dbContext.EmployeeDetails.Add(_employeeDetails);
                await dbContext.SaveChangesAsync();

                var salt = passwordHasher.GenerateSalt();

                var _userLoginDetails = new UserLogins
                {
                    ID       = await mediator.Send(new GetIdentifierQuery { Employee = _employeeDetails }),
                    Username = _employeeDetails.Email,
                    Salt     = salt,
                    Password = passwordHasher.HashPassword(salt, "uniwallet")
                };

                dbContext.UserLogins.Add(_userLoginDetails);
                await dbContext.SaveChangesAsync();


                var _loginDetails = new LoginDetailsVM
                {
                    Username = _employeeDetails.Email,
                    Password = "******"
                };

                return(_loginDetails);
            }
Beispiel #3
0
        public List <EmployeeDetails> DisplayEmployeeDetails()
        {
            string                 connectionString = ConfigurationManager.ConnectionStrings["Constring"].ConnectionString;
            EmployeeDetails        emplopyedetails  = null;
            List <EmployeeDetails> employee         = new List <EmployeeDetails>();

            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                SqlCommand cmd = new SqlCommand("select * from empdetails", connection);
                connection.Open();
                SqlDataReader rdr = cmd.ExecuteReader();
                while (rdr.Read())
                {
                    emplopyedetails               = new EmployeeDetails();
                    emplopyedetails.Associateid   = rdr["associateId"].ToString();
                    emplopyedetails.Role          = rdr["role"].ToString();
                    emplopyedetails.Associatename = rdr["associatename"].ToString();
                    emplopyedetails.Projectname   = rdr["projectname"].ToString();
                    emplopyedetails.Managername   = rdr["managername"].ToString();
                    employee.Add(emplopyedetails);
                }
            }
            return(employee);
        }
        public ActionResult Index(EmployeeDetails a)
        {
            Property p  = new Property();
            DataSet  ds = new DataSet();

            p.OnTable    = "FetchEmployeeLogin";
            p.Condition1 = a.EmailId;
            p.Condition2 = a.Password;

            ds = dl.FetchEmployee_sp(p);
            try
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    HttpCookie rxgoEmployeeCookie = Request.Cookies["rxgoEmployee"];
                    rxgoEmployeeCookie         = new HttpCookie("rxgoEmployee");
                    rxgoEmployeeCookie["Eid"]  = ds.Tables[0].Rows[0]["EmployeeId"].ToString();
                    rxgoEmployeeCookie["Utyp"] = ds.Tables[0].Rows[0]["UserTypeId"].ToString();
                    rxgoEmployeeCookie.Expires = DateTime.Now.AddDays(1);
                    Response.Cookies.Add(rxgoEmployeeCookie);
                    return(RedirectToAction("Index", "Employees"));
                }
                else
                {
                    TempData["MSGlogin"] = "******";
                }
            }
            catch (Exception ex)
            {
                TempData["MSGlogin"] = "******";
            }

            TempData["MSG"] = "Email-id / Password is incorrect or account not active!";

            return(RedirectToAction("Index", "EmployeeLogin"));
        }
Beispiel #5
0
        public void TestAddIntoDatabaseOfHandleDatabseClassPassEmployeeDetailsObejctsAndGetTheNumberOfRowsAffected()
        {
            EmployeeDetails employeeDetails = new EmployeeDetails()
            {
                EmployeeID = 12,
                Name       = "New Name",
                StartDate  = Convert.ToDateTime("05/04/2020"),
                Gender     = "F",
                Phone      = "7889564512",
                SalaryID   = 115,
                Address    = "New Address",
                IsActive   = 1
            };
            CompanyData companyData = new CompanyData()
            {
                DepartmentID   = 510,
                DepartmentName = "New Department 5"
            };
            Department department = new Department()
            {
                DepartmentID = 510,
                EmployeeID   = 12
            };
            PayrollDetails payrollDetails = new PayrollDetails()
            {
                SalaryID  = 115,
                BasicPay  = 7889,
                Deduction = 78,
                IncomeTax = 56,
                NetPay    = 7715,
                Taxable   = 156
            };
            int actual = HandleDatabase.AddAnEmployee(employeeDetails, companyData, department, payrollDetails);

            Assert.AreEqual(4, actual);
        }
Beispiel #6
0
        public void TestGetNameDiscountFlagFailed()
        {
            //test data
            var emp = new EmployeeDetails()
            {
                FirstName  = "syed",
                LastName   = "Abdi",
                Dependents = new List <DTO.Results.Info>()
                {
                    new DTO.Results.Info()
                    {
                        FirstName = "John", LastName = "Steve"
                    }
                }
            };
            string name = "a";

            object[] tesdata = new object[] { emp, name };

            MethodInfo magicMethod = _magicType.GetMethod("GetNameDiscountFlag");
            object     result      = magicMethod.Invoke(magicMethod, tesdata);

            Assert.IsFalse(Convert.ToBoolean(result));
        }
        private void saveWorkexperinceDetails(ref SqlConnection _sqlconnection)
        {
            var _employeedetails = new EmployeeDetails();

            _employeedetails.WorkExperience = new Models.WorkExperience
            {
                FirstCompanyName = "Bally",
                From             = "2010",
                To       = "2012",
                Skillset = ".Net"
            };
            _sqlconnection.Open();
            SqlCommand _sqlcommandworkexperience = new SqlCommand("Insert into  WorkExperience(CompanyName,[From],[To],Skillset,EmployeeId) values(@CompanyName,@From,@To,@Skillset,@EmployeeId)", _sqlconnection);

            _sqlcommandworkexperience.Parameters.AddWithValue("@CompanyName", _employeedetails.WorkExperience.FirstCompanyName);
            _sqlcommandworkexperience.Parameters.AddWithValue("@From", Convert.ToInt16(_employeedetails.WorkExperience.From));
            _sqlcommandworkexperience.Parameters.AddWithValue("@To", Convert.ToInt16(_employeedetails.WorkExperience.To));
            _sqlcommandworkexperience.Parameters.AddWithValue("@Skillset", _employeedetails.WorkExperience.Skillset);
            _sqlcommandworkexperience.Parameters.AddWithValue("@EmployeeId", 1);
            var            _workexpereinceResult = _sqlcommandworkexperience.ExecuteNonQuery();
            DisplayProfile displayprofile        = new DisplayProfile();

            displayprofile.Show();
        }
        //Method for getting request details for particular employee code
        public RequestDetails GetUserByEmpcode(string code)
        {
            //Details
            Requests        req     = _reqRepo.GetRequestByEmpcode(code);
            EmployeeDetails empName = _empRepo.GetOneEmployee(req.EmployeeCode);
            EmployeeDetails supName = _empRepo.GetSupervisor(req.SupervisorCode);
            RequestDetails  model   = new RequestDetails();

            model.DateOfRequest           = req.DateOfRequest;
            model.EmployeeCode            = req.EmployeeCode;
            model.EmployeeName            = empName.EmployeeName;
            model.SupervisorCode          = empName.SupervisorCode;
            model.SupervisorName          = supName.SupervisorName;
            model.Newpacode               = req.NewPaCode;
            model.Newpsacode              = req.NewPsaCode;
            model.NewOucode               = req.NewOuCode;
            model.NewCcCode               = req.NewCcCode;
            model.RequestStatus           = req.RequestStatus;
            model.TypeOfRequest           = req.TypeOfRequest;
            model.pendingWith             = req.PendingWith;
            model.DateOfTransfer          = req.DateOfTransfer;
            model.DateOfCompletionRequest = req.DateOfCompletionRequest;
            return(model);
        }
        public IEnumerable <EmployeeDetails> Post(IFormFile files, [FromForm] string empdata)
        {
            var id = ObjectId.Parse("605764c67d2e861b2cb9d1fd");

            EmployeeDetails empList = JsonConvert.DeserializeObject <EmployeeDetails>(empdata);

            Debug.WriteLine("City" + empList.Address[0].City);
            Debug.WriteLine("City" + empList.Name);
            // Full path to file in temp location
            var filePath = Path.GetTempFileName();

            if (files.Length > 0)
            {
                var Addresses = new Address[]
                {
                    new Address()
                    {
                        Id   = ObjectId.GenerateNewId(),
                        City = empList.Address[0].City
                    }
                };
                EmployeeDetails Emp = new EmployeeDetails();
                Emp.Name    = empList.Name;
                Emp.Address = Addresses;
                _EmployeeCollection.InsertOne(Emp);
                return(_EmployeeCollection.Find(_ => true).ToList());
            }

            /*using (var stream = new FileStream(filePath, FileMode.Create))
             *  await formFile.CopyToAsync(stream);*/


            // Process uploaded files

            return(_EmployeeCollection.Find(_ => true).ToList());
        }
        //Checks user credentials, returns the object containing details of employee if it exists
        public CustomEmployee checkUser(CustomEmployee customEmployee)
        {
            CustomEmployee  employee     = null;
            EmployeeDetails tempEmployee = _employeesContext.EmployeeDetails.Where(x => x.Username == customEmployee.Username && x.EmpPassword == customEmployee.EmpPassword).FirstOrDefault();

            if (tempEmployee != null)
            {
                employee = new CustomEmployee
                {
                    //EmpName, EMpPhone etc... is stored in my Database, and if I change it now then, I have to
                    //perform the scaffolding again. I'll take care of these conventions from now.
                    //SORRY !
                    EmpName      = tempEmployee.EmpName,
                    Username     = tempEmployee.Username,
                    EmpPhone     = tempEmployee.EmpPhone,
                    EmpRole      = tempEmployee.EmpRole,
                    EmpProjectId = tempEmployee.EmpProjectId,
                    EmpFlag      = tempEmployee.EmpFlag,
                    AdminFlag    = tempEmployee.AdminFlag
                };
                return(employee);
            }
            return(employee);
        }
 public Employee()
 {
     EmployeeDetails         = new EmployeeDetails();
     EmployeeDetails.EmpID   = 123;
     EmployeeDetails.EmpName = "ABC";
 }
Beispiel #12
0
        public DbResult Update(EmployeeDetails obj, string flag)
        {
            SqlParameter[] param = { new SqlParameter("@flag", SqlDbType.VarChar,                         50)
                                     {
                                         Value = flag == "i"? "i":"u"
                                     }
                                     ,                         new SqlParameter("@Id",            SqlDbType.Int)
                                     {
                                         Value = obj.Id
                                     }
                                     ,                         new SqlParameter("@FirstName",     SqlDbType.VarChar, 50)
                                     {
                                         Value = obj.FirstName
                                     }
                                     ,                         new SqlParameter("@MiddleName",    SqlDbType.VarChar, 30)
                                     {
                                         Value = obj.MiddleName
                                     }
                                     ,                         new SqlParameter("@LastName",      SqlDbType.VarChar, 30)
                                     {
                                         Value = obj.LastName
                                     }
                                     ,                         new SqlParameter("@Gender",        SqlDbType.VarChar, 20)
                                     {
                                         Value = obj.Gender
                                     }
                                     ,                         new SqlParameter("@Phone",         SqlDbType.VarChar, 20)
                                     {
                                         Value = obj.Phone
                                     }

                                     ,                         new SqlParameter("@Nationality",   SqlDbType.VarChar, 20)
                                     {
                                         Value = obj.Nationality
                                     }
                                     ,                         new SqlParameter("@DOB",           SqlDbType.Date)
                                     {
                                         Value = obj.DOB
                                     }
                                     ,                         new SqlParameter("@MaritalStatus", SqlDbType.VarChar, 20)
                                     {
                                         Value = obj.MaritalStatus
                                     }
                                     ,                         new SqlParameter("@Ethnicity",     SqlDbType.VarChar, 30)
                                     {
                                         Value = obj.Ethnicity
                                     }
                                     ,                         new SqlParameter("@StateId",       SqlDbType.Int)
                                     {
                                         Value = obj.StateId
                                     }
                                     ,                         new SqlParameter("@DistrictId",    SqlDbType.Int)
                                     {
                                         Value = obj.DistrictId
                                     }

                                     ,                         new SqlParameter("@Address",       SqlDbType.VarChar, 50)
                                     {
                                         Value = obj.Address
                                     }
                                     ,                         new SqlParameter("@Email",         SqlDbType.VarChar, 60)
                                     {
                                         Value = obj.Email
                                     }

                                     ,                         new SqlParameter("@userId",        SqlDbType.NVarChar, 128)
                                     {
                                         Value = SessionHelper.GetUserID()
                                     } };
            return(SqlHelper.ParseDbResult("spEmployee", param));
        }
    public MainWindow()
    {
        InitializeComponent();
        var detail1 = new EmployeeDetails()
        {
            ManagerID = 11, ManagerName = "11 Name", ManagerMobile = "123456"
        };
        var detail2 = new EmployeeDetails()
        {
            ManagerID = 12, ManagerName = "12 Name", ManagerMobile = "123456"
        };
        var detail3 = new EmployeeDetails()
        {
            ManagerID = 13, ManagerName = "13 Name", ManagerMobile = "123456"
        };
        var detail4 = new EmployeeDetails()
        {
            ManagerID = 11, ManagerName = "11 Name", ManagerMobile = "123456"
        };
        var detail5 = new EmployeeDetails()
        {
            ManagerID = 12, ManagerName = "12 Name", ManagerMobile = "123456"
        };
        var detail6 = new EmployeeDetails()
        {
            ManagerID = 13, ManagerName = "13 Name", ManagerMobile = "123456"
        };
        var detail7 = new EmployeeDetails()
        {
            ManagerID = 11, ManagerName = "11 Name", ManagerMobile = "123456"
        };
        var detail8 = new EmployeeDetails()
        {
            ManagerID = 12, ManagerName = "12 Name", ManagerMobile = "123456"
        };
        var detail9 = new EmployeeDetails()
        {
            ManagerID = 13, ManagerName = "13 Name", ManagerMobile = "123456"
        };
        var details1 = new List <EmployeeDetails>();

        details1.Add(detail1);
        details1.Add(detail2);
        details1.Add(detail3);
        var details2 = new List <EmployeeDetails>()
        {
            detail4, detail5, detail6
        };
        var details3 = new List <EmployeeDetails>()
        {
            detail7, detail8, detail9
        };

        Employees = new List <Employee>();
        Employees.Add(new Employee()
        {
            ID = 1, Name = "Name1", Details = details1
        });
        Employees.Add(new Employee()
        {
            ID = 2, Name = "Name2", Details = details2
        });
        Employees.Add(new Employee()
        {
            ID = 3, Name = "Name3", Details = details3
        });
        SelectedEmployee = Employees[1];
        this.DataContext = this;
    }
Beispiel #14
0
        /// <summary>
        /// This method is responsible for replacing placeholders in an html template called "FinalTemplate" with the respective values
        /// such as employee details, salary breakup for both addition and deduction components, gross salary,total deductions and the net pay
        /// in figures and words.
        /// </summary>
        /// <param name="employeeDetails">The employee's personal details and professional details.</param>
        /// <param name="employeePayDetails">The employee's salary breakup details divided into addition and deduction components</param>
        /// <returns>The html content having all the placeholders replaced with appropriate values.</returns>
        public string PopulateTemplate(EmployeeDetails employeeDetails, ICollection <Rules> employeePayDetails)
        {
            int           beginCounter    = -1;
            int           endCounter      = -1;
            int           largerListCount = 0;
            string        templateBody    = string.Empty;
            StringBuilder genericBuilder  = new StringBuilder();

            using (ITemplateProvider templateApplication = new TemplateProvider())
            {
                templateBody = templateApplication.SupplyTemplateStream().ReadToEnd();
            }

            templateBody = templateBody.Replace("$dateOfJoining", employeeDetails.DateOfJoining);
            templateBody = templateBody.Replace("$panNumber", employeeDetails.PanNumber);
            templateBody = templateBody.Replace("$name", employeeDetails.EmployeeName);
            templateBody = templateBody.Replace("$designation", employeeDetails.Designation);
            templateBody = templateBody.Replace("$accountNumber", employeeDetails.AccountNumber);
            templateBody = templateBody.Replace("$salary", employeeDetails.Salary);
            templateBody = templateBody.Replace("$month", employeeDetails.Month.ToUpper());
            templateBody = templateBody.Replace("$year", employeeDetails.Year);

            //New set of code -- Start.

            var additionPayDetails  = employeePayDetails.Where(a => (a.ComputationName == ComputationVariety.ADDITION) && (a.RuleName != Constants.netPay && a.RuleName != Constants.additionTotal)).ToArray();
            var deductionPayDetails = employeePayDetails.Where(a => (a.ComputationName == ComputationVariety.SUBTRACTION) && (a.RuleName != Constants.subtractionTotal)).ToArray();
            var additionTotal       = employeePayDetails.Where(a => (a.ComputationName == ComputationVariety.ADDITION) && (a.RuleName == Constants.additionTotal)).ToArray();
            var deductionTotal      = employeePayDetails.Where(a => (a.ComputationName == ComputationVariety.SUBTRACTION) && (a.RuleName == Constants.subtractionTotal)).ToArray();


            if ((additionPayDetails != null && additionPayDetails.Count() > 0) && (deductionPayDetails != null && deductionPayDetails.Count() > 0))
            {
                largerListCount = (additionPayDetails.Count() > deductionPayDetails.Count()) ? additionPayDetails.Count() : deductionPayDetails.Count();
            }

            for (int i = 0; i < largerListCount; i++)
            {
                if (beginCounter == -1)
                {
                    genericBuilder.Append("<tr class=\"alignment-style\">");
                    beginCounter++;
                }
                if ((beginCounter == 0))
                {
                    if (i < additionPayDetails.Count() && i < deductionPayDetails.Count())
                    {
                        if (additionPayDetails[i] != null && deductionPayDetails[i] != null)
                        {
                            genericBuilder.Append(string.Format("<td colspan = \"1\">{0}</td><td colspan = \"1\">{1}</td><td colspan = \"1\">{2}</td><td colspan = \"1\">{3}</td></tr>", additionPayDetails[i].RuleName, additionPayDetails[i].RuleValue, deductionPayDetails[i].RuleName, deductionPayDetails[i].RuleValue));

                            beginCounter = -1;
                            endCounter++;
                        }
                        else if (additionPayDetails[i] != null && deductionPayDetails[i] == null)
                        {
                            genericBuilder.Append(string.Format("<td colspan = \"1\">{0}</td><td colspan = \"1\">{1}</td><td colspan = \"1\">{2}</td><td colspan = \"1\">{2}</td></tr>", additionPayDetails[i].RuleName, additionPayDetails[i].RuleValue, string.Empty));
                            beginCounter = -1;
                            endCounter++;
                        }
                        else if (additionPayDetails[i] == null && deductionPayDetails[i] != null)
                        {
                            genericBuilder.Append(string.Format("<td colspan = \"1\">{0}</td><td colspan = \"1\">{0}</td><td colspan = \"2\">{1}</td><td colspan = \"1\">{2}</td></tr>", string.Empty, deductionPayDetails[i].RuleName, deductionPayDetails[i].RuleValue));
                            beginCounter = -1;
                            endCounter++;
                        }
                    }
                    else if (i < additionPayDetails.Count() && i == deductionPayDetails.Count())
                    {
                        if (additionPayDetails[i] != null)
                        {
                            genericBuilder.Append(string.Format("<td colspan = \"1\">{0}</td><td colspan = \"1\">{1}</td><td colspan = \"1\">{2}</td><td colspan = \"1\">{2}</td></tr>", additionPayDetails[i].RuleName, additionPayDetails[i].RuleValue, string.Empty));
                            beginCounter = -1;
                            endCounter++;
                        }
                    }
                    else if (i == additionPayDetails.Count() && i < deductionPayDetails.Count())
                    {
                        if (deductionPayDetails[i] != null)
                        {
                            genericBuilder.Append(string.Format("<td colspan = \"1\">{0}</td><td colspan = \"1\">{0}</td><td colspan = \"1\">{1}</td><td colspan = \"1\">{2}</td></tr>", string.Empty, deductionPayDetails[i].RuleName, deductionPayDetails[i].RuleValue));
                            beginCounter = -1;
                            endCounter++;
                        }
                    }
                }
            }
            if (endCounter == largerListCount - 1)
            {
                if ((additionTotal != null && additionTotal.Count() > 0) && (deductionTotal != null && deductionTotal.Count() > 0))
                {
                    genericBuilder.Append(string.Format("<tr class=\"alignment-style\"><td colspan = \"1\">{0}</td><td colspan = \"1\">{1}</td><td colspan = \"1\">{2}</td><td colspan = \"1\">{3}</td></tr>", Constants.grossSalary, additionTotal[0].RuleValue, Constants.totalDeduction, deductionTotal[0].RuleValue));
                }
                else if ((additionTotal != null && additionTotal.Count() > 0) && (deductionTotal == null || deductionTotal.Count() == 0))
                {
                    genericBuilder.Append(string.Format("<tr class=\"alignment-style\"><td colspan = \"1\">{0}</td><td colspan = \"1\">{1}</td><td colspan = \"1\">{2}</td><td colspan = \"1\">{2}</td></tr>", Constants.grossSalary, additionPayDetails[0].RuleValue, string.Empty));
                }
                else if ((additionTotal == null || additionTotal.Count() == 0) && (deductionTotal != null && deductionTotal.Count() > 0))
                {
                    genericBuilder.Append(string.Format("<tr class=\"alignment-style\"><td colspan = \"1\">{0}</td><td colspan = \"1\">{0}</td><td colspan = \"1\">{1}</td><td colspan = \"1\">{2}</td></tr>", string.Empty, Constants.totalDeduction, deductionPayDetails[0].RuleValue));
                }
            }


            if (genericBuilder != null && genericBuilder.Length > 0)
            {
                templateBody = templateBody.Replace("$additionAndDeductionComponents", genericBuilder.ToString());
            }
            else
            {
                templateBody = templateBody.Replace("$additionAndDeductionComponents", string.Empty);
            }
            genericBuilder.Clear();
            //New set of code -- Stop.


            var details            = employeePayDetails.Where(a => a.RuleName == Constants.netPay).Select(a => a).ToList();
            var ruleValue          = details[0].RuleValue.ToString("#,#.##", System.Globalization.CultureInfo.CreateSpecificCulture("hi-IN"));
            var ruleValueinDecimal = Convert.ToDecimal(ruleValue);

            genericBuilder.Append(string.Format("<tr class=\"alignment-style\"><td colspan=\"3\">{0}:</td><td colspan=\"1\">{1}</td></tr>", details[0].RuleName, ruleValue));
            templateBody = templateBody.Replace("$netPay", genericBuilder.ToString());
            genericBuilder.Clear();
            var value = (NumberToWordsExtension.ToWords((long)ruleValueinDecimal)).Titleize();

            genericBuilder.Append(string.Format("<tr><td colspan=\"1\" class=\"left-alignment-style\">Net Pay in Words:</td><td colspan=\"3\" class=\"alignment-style-center\">{0}</td></tr>", value));
            templateBody = templateBody.Replace("$payInWords", genericBuilder.ToString());
            genericBuilder.Clear();
            templateBody = templateBody.Replace("$contentOfHeader", string.Format("<img src=\"{0}\" alt=\"{1}\">", ConfigurationManager.AppSettings[Constants.headerImage], "No Image Found"));
            templateBody = templateBody.Replace("$contentOfFooter", FetchFooterContent() != null? FetchFooterContent():string.Empty);
            return(templateBody);
        }
Beispiel #15
0
            private EmployeeDetails Create(EmployeeDetails employee)
            {
                var result = sut.Create(employee) as ViewResult;

                return((EmployeeDetails)result.Model);
            }
Beispiel #16
0
        public async Task <bool> UpdateEmployee(EmployeeDetails employee, string id)
        {
            var isEmployeeUpdated = await _empCollection.ReplaceOneAsync(emp => emp.EmpId.Equals(id), employee);

            return(isEmployeeUpdated.IsAcknowledged && isEmployeeUpdated.ModifiedCount > 0);
        }
Beispiel #17
0
        /// <summary>
        /// Use to Get Employee Details on the basis of XRefcode
        /// </summary>
        /// <param name="_connectionInfo"></param>
        /// <param name="filter"></param>
        /// <returns></returns>

        public List <EmployeeDetails> GetEmployeeDetails(IDictionary <string, string> _connectionInfo, DayForceFilter filter)
        {
            List <EmployeeDetails>       employeeResponselist = new List <EmployeeDetails>();
            EmployeeDetails              employeeDetails      = new EmployeeDetails();
            EmployeeDetailsBasicResponse employeeResponsedata = new EmployeeDetailsBasicResponse();

            completeUrl = string.Concat(BaseUrl, GetEmployeeDetailsUri);
            if (filter != null)
            {
                for (int i = 0; i < filter.name.Count; i++)
                {
                    if (filter.name[i] == "EmployeeDetails.XRefCode")
                    {
                        count = ++count;
                    }
                }
                if (count == 0)
                {
                    throw new WebException("XRefCode required,please provide XRefCode");
                }
                for (int i = 0; i < filter.name.Count; i++)
                {
                    Name  = filter.name[i];
                    Value = filter.value[i];
                    if (filter.name[i] != "EmployeeDetails.XRefCode")
                    {
                        if (i == 0)
                        {
                            filterUrl = "?";
                        }
                    }
                    if (i == (filter.name.Count - 1))
                    {
                        if (filter.name[i] == "EmployeeDetails.XRefCode")
                        {
                            filterUrl = filter.value[i];
                        }
                        if (filter.name[i] == "EmployeeDetails.contextDate")
                        {
                            string   line = filter.value[i];
                            DateTime dt   = new DateTime();
                            dt = Convert.ToDateTime(line);
                            var date = dt.ToString("yyyy-MM-dd" + "T" + "HH:mm:ss");
                            Value      = date;
                            filterUrl += Name + " = " + Value;
                        }
                        else
                        {
                            if (filter.name[i] != "EmployeeDetails.XRefCode")
                            {
                                filterUrl += Name + " = " + Value;
                            }
                        }
                    }
                    else
                    {
                        if (filter.name[i] == "EmployeeDetails.XRefcode")
                        {
                            filterUrl = filter.value[i];
                        }
                        if (filter.name[i] == "EmployeeDetails.contextDate")
                        {
                            string   line = filter.value[i];
                            DateTime dt   = new DateTime();
                            dt = Convert.ToDateTime(line);
                            var date = dt.ToString("yyyy-MM-dd" + "T" + "HH:mm:ss");
                            Value      = date;
                            filterUrl += Name + "=" + Value + "&";
                        }
                        else
                        {
                            if (filter.name[i] != "EmployeeDetails.XRefcode")
                            {
                                filterUrl += Name + "=" + Value + "&";
                            }
                        }
                    }
                }
                filterUrl   = filterUrl.Replace("EmployeeDetails.", " ");
                filterUrl   = filterUrl.Replace(" ", "");
                completeUrl = string.Concat(BaseUrl, GetEmployeeDetailsUri, filterUrl);

                HttpWebResponse response = service.HttpRequest(_connectionInfo, completeUrl, HttpMethods.GET.ToString(), null);

                if (response != null && response.StatusCode == HttpStatusCode.OK)
                {
                    var encoding = ASCIIEncoding.ASCII;
                    using (var reader = new System.IO.StreamReader(response.GetResponseStream(), encoding))
                    {
                        string responseText = reader.ReadToEnd();
                        employeeResponsedata = JsonConvert.DeserializeObject <EmployeeDetailsBasicResponse>(responseText);
                    }

                    employeeDetails = EmployeeHierarchicalToFlatConverter.EmployeeDetailsHierarchicalToFlatConverter(employeeResponsedata);

                    employeeResponselist.Add(employeeDetails);
                }
            }
            if (filter == null)
            {
                throw new WebException("Please sepecify the Value of XrefCode");
            }
            return(employeeResponselist);
        }
Beispiel #18
0
 public ActionResult SwapEmployeePriority(string empId, string firstPriority, string secondPriority)
 {
     EmployeeDetails.SwapEmployeePriority(empId, firstPriority, secondPriority);
     return(GetEmployeePriority(empId));
 }
Beispiel #19
0
            public void list()
            {
                employeeDetails = new List<EmployeeDetails>();
                EmployeeDetails employee1 = new EmployeeDetails();
                Console.WriteLine("enter 1st employee  details");
                Console.WriteLine("Enter employee number");
                employee1.empNo = int.Parse(Console.ReadLine());
                Console.WriteLine("Enter employee name");
                employee1.empName = Console.ReadLine();
                Console.WriteLine("enter employee department");
                employee1.deptName = Console.ReadLine();
                Console.WriteLine("enter employee salary");
                employee1.salary = int.Parse(Console.ReadLine());


                EmployeeDetails employee2 = new EmployeeDetails();
                Console.WriteLine("enter 2nd employee  details");
                Console.WriteLine("Enter employee number");
                employee2.empNo = int.Parse(Console.ReadLine());
                Console.WriteLine("Enter employee name");
                employee2.empName = Console.ReadLine();
                Console.WriteLine("enter employee department");
                employee2.deptName = Console.ReadLine();
                Console.WriteLine("enter employee salary");
                employee2.salary = int.Parse(Console.ReadLine());

                EmployeeDetails employee3 = new EmployeeDetails();
                Console.WriteLine("enter 3rd employee  details");
                Console.WriteLine("Enter employee number");
                employee3.empNo = int.Parse(Console.ReadLine());
                Console.WriteLine("Enter employee name");
                employee3.empName = Console.ReadLine();
                Console.WriteLine("enter employee department");
                employee3.deptName = Console.ReadLine();
                Console.WriteLine("enter employee salary");
                employee3.salary = int.Parse(Console.ReadLine());

                EmployeeDetails employee4 = new EmployeeDetails();
                Console.WriteLine("enter 4th employee  details");
                Console.WriteLine("Enter employee number");
                employee4.empNo = int.Parse(Console.ReadLine());
                Console.WriteLine("Enter employee name");
                employee4.empName = Console.ReadLine();
                Console.WriteLine("enter employee department");
                employee4.deptName = Console.ReadLine();
                Console.WriteLine("enter employee salary");
                employee4.salary = int.Parse(Console.ReadLine());

                EmployeeDetails employee5 = new EmployeeDetails();
                Console.WriteLine("enter 5th employee  details");
                Console.WriteLine("Enter employee number");
                employee5.empNo = int.Parse(Console.ReadLine());
                Console.WriteLine("Enter employee name");
                employee5.empName = Console.ReadLine();
                Console.WriteLine("enter employee department");
                employee5.deptName = Console.ReadLine();
                Console.WriteLine("enter employee salary");
                employee5.salary = int.Parse(Console.ReadLine());

                employeeDetails.Add(employee1);
                employeeDetails.Add(employee2);
                employeeDetails.Add(employee3);
                employeeDetails.Add(employee4);
                employeeDetails.Add(employee5);
                Console.WriteLine("=============================================================================");
                foreach (var details in employeeDetails)
                {

                    Console.WriteLine($" \n {details.empName} details are\n \n employee name: {details.empName} \n employee number: {details.empNo} \n employee department: {details.deptName}\n employee salary: {details.salary}");

                }

                Console.WriteLine("===============================================================================");
            }
Beispiel #20
0
 public void Post(EmployeeDetails employee)
 {
     EmployeeBusinessLayer.Post(employee);
 }
Beispiel #21
0
        public async Task <EmployeeDetails> CreateEmployee(EmployeeDetails emp)
        {
            await _empCollection.InsertOneAsync(emp);

            return(emp);
        }
 public static bool GetNameDiscountFlag(EmployeeDetails rec, string name)
 {
     return((rec.FirstName.ToLower().StartsWith(name) || rec.Dependents.Any(x => x.FirstName.ToLower().StartsWith(name))) == true ? true : false);
 }
Beispiel #23
0
 public WorkExperienceDetails(EmployeeDetails employeeeducation)
 {
     InitializeComponent();
     _employeedetails = employeeeducation;
 }
        protected void save_Click(object sender, EventArgs e)
        {
            if (gvEmpDetails.ShowFooter)
            {
                EmployeeDetails emp = new EmployeeDetails();
                emp.id = (gvEmpDetails.FooterRow.FindControl("newtxtid") as TextBox).Text;
                if (emp.id == "")
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "RecordsTextopenModaladded", "openWarningModal('Employee Id required.');", true);
                    return;
                }

                emp.AdminName = Session["EmpName"].ToString();
                emp.Name      = (gvEmpDetails.FooterRow.FindControl("newtxtname") as TextBox).Text;
                emp.role      = (gvEmpDetails.FooterRow.FindControl("newddlrole") as DropDownList).SelectedItem.ToString();
                emp.email     = (gvEmpDetails.FooterRow.FindControl("newtxtemail") as TextBox).Text;
                emp.mblno     = (gvEmpDetails.FooterRow.FindControl("newtxtmblno") as TextBox).Text;
                emp.password  = (gvEmpDetails.FooterRow.FindControl("newtxtpassword") as TextBox).Text;

                int success = DBAccess.saveEmployeeDetails(emp, "New");
                if (success.Equals(0))
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "RecordsTextopenModaladded", "openErrorModal('Record insertion failed.');", true);
                    return;
                }
                else if (success < 0)
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "RecordsTextopenModaladded", "openWarningModal('Employee ID already exists.');", true);
                    return;
                }


                gvEmpDetails.ShowFooter = false;
                BindEmployeeDetails("");
                Button1.Visible = false;
                newEmp.Visible  = true;
                ScriptManager.RegisterStartupScript(this, typeof(Page), "Success" + 1, "<script>showpop5('Record saved successfully!')</script>", false);
            }
            else
            {
                for (int i = 0; i < gvEmpDetails.Rows.Count; i++)
                {
                    EmployeeDetails emp = new EmployeeDetails();
                    emp.id        = (gvEmpDetails.Rows[i].FindControl("lblid") as Label).Text;
                    emp.Name      = (gvEmpDetails.Rows[i].FindControl("txtname") as TextBox).Text;
                    emp.role      = (gvEmpDetails.Rows[i].FindControl("ddlrole") as DropDownList).SelectedItem.ToString();
                    emp.email     = (gvEmpDetails.Rows[i].FindControl("txtemail") as TextBox).Text;
                    emp.mblno     = (gvEmpDetails.Rows[i].FindControl("txtmblno") as TextBox).Text;
                    emp.password  = (gvEmpDetails.Rows[i].FindControl("txtpassword") as TextBox).Text;
                    emp.AdminName = Session["EmpName"].ToString();
                    int success = DBAccess.saveEmployeeDetails(emp, "Update");
                    if (success.Equals(0))
                    {
                        ScriptManager.RegisterStartupScript(this, GetType(), "RecordsTextopenModaladded", "openErrorModal('Records insertion failed.');", true);
                        return;
                    }
                    //gvEmpDetails.EditIndex = -1;
                }
                BindEmployeeDetails("");
                ScriptManager.RegisterStartupScript(this, typeof(Page), "Success" + 1, "<script>showpop5('Records saved successfully!')</script>", false);
            }
        }
Beispiel #25
0
 public override void SetUp()
 {
     base.SetUp();
     employee = new EmployeeDetails();
 }
        public EmployeeDetails GetEmployeeList(string uid)
        {
            EmployeeDetails obj = new EmployeeDetails();

            List <Model_EmployeeList> emp = new List <Model_EmployeeList>();

            DataTable dt = new DataTable();

            string           q       = "select * from nworksuser where uid='" + uid + "';";
            MySqlCommand     cmd     = new MySqlCommand(q, conn);
            MySqlDataAdapter adapter = new MySqlDataAdapter(cmd);;

            conn.Open();
            adapter.Fill(dt);
            conn.Close();


            string       q1           = "select * from additional_earned_leaves where uid='" + uid + "' and current_year='" + DateTime.Today.Year.ToString() + "';";
            MySqlCommand cmd1         = new MySqlCommand(q1, conn);
            float        RolledLeaves = 0;
            float        EarnedLeaves = 0;

            conn.Open();
            MySqlDataReader rdr1 = cmd1.ExecuteReader();

            while (rdr1.Read())
            {
                RolledLeaves = rdr1.GetFloat("Rolled_Over_from_Previous_Year");
                EarnedLeaves = rdr1.GetFloat("Earned_in_current_year");
            }
            conn.Close();


            Model_EmployeeList employee = new Model_EmployeeList();


            foreach (DataRow row in dt.Rows)
            {
                employee.uid          = row["uid"].ToString();
                employee.fname        = row["fname"].ToString();
                employee.mname        = row["mname"].ToString();
                employee.lname        = row["lname"].ToString();
                employee.dob          = Convert.ToDateTime(row["dob"]);
                employee.gender       = row["gender"].ToString();
                employee.desg         = row["desg"].ToString();
                employee.hire_date    = Convert.ToDateTime(row["hire_date"]);
                employee.username     = row["username"].ToString();
                employee.addressLine1 = row["addressLine1"].ToString();
                employee.addressLine2 = row["addressLine2"].ToString();
                employee.state        = row["state"].ToString();
                employee.city         = row["city"].ToString();
                employee.pincode      = row["pincode"].ToString();
                employee.country      = row["country"].ToString();
                employee.leaveDate    = Convert.ToDateTime(row["leaveDate"]);
                employee.anniversary  = Convert.ToDateTime(row["annivarsary"]);
                employee.email        = row["email"].ToString();
                employee.mobileNo     = row["mobileno"].ToString();
                employee.userActive   = row["useractive"].ToString();
                employee.Leaves_Rolled_Over_from_Previous_yr = RolledLeaves;
                employee.Additional_Earned_Leaves            = EarnedLeaves;
                emp.Add(employee);
            }

            obj.ServiceStatus = "Success";
            obj.Emp           = employee;
            return(obj);
        }
Beispiel #27
0
        public string CreditCardAndBillingDetails(string cardHolderName, int cardType, string cardNumber, int CVV, int cardExpMonth, int cardExpYear,
                                                  string Name, string address, int country, string postalCode, string phoneNumber, string email)
        {
            empDetails  = new EmployeeDetails();
            ccDetails   = new CreditCardDetails();
            repository  = new ICONHRRepository();
            responseMsg = string.Empty;
            int empId = 0;

            try
            {
                //Employee details
                empDetails            = (EmployeeDetails)Session["EmployeeModel"];
                empDetails.Country_ID = Convert.ToInt32(country);
                responseMsg           = repository.AddNewEmpDetails(empDetails);

                string[] arrResponse = responseMsg.Split(',');
                if (response.Length > 1)
                {
                    responseMsg = Convert.ToString(arrResponse[0]);
                    empId       = Convert.ToInt32(arrResponse[1]);
                    if (empId != 0)
                    {
                        // Card Card details
                        repository                  = new ICONHRRepository();
                        ccDetails.Emp_ID            = empId;
                        ccDetails.CardHolder        = cardHolderName;
                        ccDetails.CardTypeID        = cardType;
                        ccDetails.CardNumber        = cardNumber;
                        ccDetails.CVV               = CVV;
                        ccDetails.Card_Exp_Month_ID = cardExpMonth;
                        ccDetails.Card_Exp_Year_ID  = cardExpYear;

                        // Billing details
                        ccDetails.Name               = Name;
                        ccDetails.Address            = address;
                        ccDetails.Country_ID         = country;
                        ccDetails.PostalCode         = postalCode;
                        ccDetails.BillingEmail       = email;
                        ccDetails.BillingPhoneNumber = phoneNumber;
                        ccDetails.Created_By         = empDetails.Created_By;

                        responseMsg = repository.AddCreditCardDetails(ccDetails);

                        if (responseMsg == response)
                        {
                            Session["EmployeeModel"] = null;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.StackTrace trace = new System.Diagnostics.StackTrace(ex, true);
                var    frame          = trace.FrameCount > 1 ? trace.GetFrame(1) : trace.GetFrame(0);
                int    Line           = (int)frame.GetFileLineNumber();
                string methodName     = this.ControllerContext.RouteData.Values["action"].ToString();
                string controllerName = this.ControllerContext.RouteData.Values["controller"].ToString();
                LogClass.CreateLogXml(ex.Message, controllerName, Convert.ToString(ex.InnerException), methodName, Line);
            }

            return(responseMsg);
        }
Beispiel #28
0
 public void AddNewEmployee(EmployeeDetails objEmp)
 {
     Console.WriteLine("Employee added successfully");
     // throw new NotImplementedException();
 }
Beispiel #29
0
        public async Task <EmployeeDetails> GetEmployeeDetails(int badgeNumber)
        {
            EmployeeDetails result = await travelRequestRepo.GetEmployeeDetails(badgeNumber).ConfigureAwait(false);

            return(result);
        }
Beispiel #30
0
 public void UpdateEmployee(EmployeeDetails objEmp)
 {
     throw new NotImplementedException();
 }