//[HttpGet] //public ActionResult Delete(int id) //{ // //return View(db.Salaries.Where(model => model.SalaryId == id).FirstOrDefault()); // var list = db.Salaries.Where(model => model.SalaryId == id).FirstOrDefault(); // Salary salary_list = new Salary // { // SalaryId = list.SalaryId, // Basic = list.Basic, // Allowance = list.Allowance, // Medical = list.Medical, // Tax = list.Tax, // LabourWelfare = list.LabourWelfare, // Fund = list.Fund, // NetSalary = list.NetSalary // //CmpId = list.CmpId, // //DeptId = list.DeptId, // //EmpId = list.EmpId // }; // return Json(salary_list, JsonRequestBehavior.AllowGet); // //return View(list); //} //[HttpPost] //[ActionName("Delete")] //public ActionResult Delete1() //{ // //string id = Request["cmpid1"]; // //Salary sal= db.Salaries.Where(model => model.SalaryId == id).FirstOrDefault(); // //db.Salaries.Remove(sal); // //db.SaveChanges(); // //db.Entry(sal).State = EntityState.Deleted; // //db.SaveChanges(); // //if (a > 0) // //{ // // ViewBag.delete = "<script>alert('Data Deleted!!')</script>"; // // ModelState.Clear(); // //} // //else // //{ // // ViewBag.delete = "<script>alert('Data not Deleted!!')</script>"; // //} // string id = Request["empid2"]; // DBManager.DeleteSalary(id); // return RedirectToAction("Salary", "Salary"); //} //string empcompany = Request["empcompany"]; //string empdept = Request["empdept"]; //string empsal = Request["empsal"]; //string basicsal = Request["basicsal"]; //string allowance = Request["allowance"]; //string medallowance = Request["medallowance"]; //string tax = Request["tax"]; //string labour = Request["labour"]; //string fund = Request["fund"]; //string totalsal = Request["totalsal"]; //DBManager.AddSalary(basicsal, allowance, medallowance, tax, labour, fund, totalsal, empcompany, empdept, empsal); //return View(); //} public ActionResult PaySlip() { List <Salary> Salary_List = db.Salaries.ToList(); SalaryViewmodell Salary_View_Model = new SalaryViewmodell(); List <SalaryViewmodell> Salary_View_List = Salary_List.Select(x => new SalaryViewmodell { SalaryId = x.SalaryId, Basic = x.Basic, Allowance = x.Allowance, Medical = x.Medical, Tax = x.Tax, LabourWelfare = x.LabourWelfare, Fund = x.Fund, NetSalary = x.NetSalary, C_Name = x.Company.CmpName, D_Name = x.Department.DeptName, E_Name = x.Employee.LName, //U_Id = x.User.Login, //RType = x.Role.RoleType, CmpId = x.CmpId, DeptId = x.DeptId, EmpId = x.EmpId, //RoleId = x.RoleId, UserId = x.UserId }).ToList(); ViewBag.salary = Salary_View_List; return(View()); }
public ActionResult CmpEmpSalary() { var cmplist = db.Companies.ToList(); var Cmplist = new SelectList(cmplist, "CmpId", "CmpName"); ViewBag.cmp = Cmplist; int CmpId = Convert.ToInt32(Session["CompanyId"].ToString()); var deptlist = db.Departments.Where(a => a.CmpId == CmpId).ToList(); var Deplist = new SelectList(deptlist, "DeptId", "DeptName"); ViewBag.dept = Deplist; var emplist = db.Employees.ToList(); var Emplist = new SelectList(emplist, "EmpId", "LName"); ViewBag.emp = Emplist; var role = db.Roles.ToList(); var Role = new SelectList(role, "RoleId", "RoleType"); ViewBag.role = Role; List <Salary> Salary_List = db.Salaries.ToList(); SalaryViewmodell Salary_View_Model = new SalaryViewmodell(); List <SalaryViewmodell> Salary_View_List = Salary_List.Select(x => new SalaryViewmodell { SalaryId = x.SalaryId, Basic = x.Basic, Allowance = x.Allowance, Medical = x.Medical, Tax = x.Tax, LabourWelfare = x.LabourWelfare, Fund = x.Fund, NetSalary = x.NetSalary, C_Name = x.Company.CmpName, D_Name = x.Department.DeptName, E_Name = x.Employee.LName, E_Image = x.Employee.EmpImage, //U_Id = x.User.Login, //RType = x.Role.RoleType, CmpId = x.CmpId, DeptId = x.DeptId, EmpId = x.EmpId, //RoleId = x.RoleId, UserId = x.UserId }).ToList(); ViewBag.sal = Salary_View_List; return(View()); }