public ActionResult Edit(VehicleRepairingItem model) { // int Empid = Convert.ToInt32(Url.RequestContext.RouteData.Values["id"].ToString()); //model.EmpID = Empid; VehicleRepairingService objVRepairing = new VehicleRepairingService(); model.UpdatedOn = System.DateTime.Now; objVRepairing.Update(model); return RedirectToAction("Create", new { @menuId = model.Viewbagidformenu }); }
public ActionResult Create(VehicleRepairingItem model) { //int Empid = Convert.ToInt32(Url.RequestContext.RouteData.Values["id"].ToString()); //model.emp = Empid; VehicleRepairingService objVRep = new VehicleRepairingService(); int cid = 0; if (Session["CompID"] != null) { cid = Convert.ToInt32(Session["CompID"].ToString()); } if (model.CompID == null) { model.CompID = cid; } objVRep.Insert(model); return RedirectToAction("Create", new { @menuId = model.Viewbagidformenu }); }
public ActionResult Create() { int Empid = 0; //if (Url.RequestContext.RouteData.Values["id"].ToString() != null) //{ //Empid = Convert.ToInt32(Url.RequestContext.RouteData.Values["id"].ToString()); //} List<VehicleRepairingItem> lstVRep = new List<VehicleRepairingItem>(); VehicleRepairingService objVrepairing = new VehicleRepairingService(); int cid = 0; if (Session["CompID"] != null) { cid = Convert.ToInt32(Session["CompID"].ToString()); } lstVRep = objVrepairing.VehicleRepairingListData(cid); VehicleRepairingItem objVRepItem = new VehicleRepairingItem(); objVRepItem.VehicleList = new List<VehicleRepairingItem>(); objVRepItem.VehicleList.AddRange(lstVRep); #region Bind DropDown Comp List<CompanyItem> lstComp = new List<CompanyItem>(); lstComp = objVrepairing.GetAllComp(); objVRepItem.ListComp = new List<CompanyItem>(); objVRepItem.ListComp.AddRange(lstComp); #endregion #region Bind DropDown Vehicle List<VehicleItem> lstVehicle = new List<VehicleItem>(); lstVehicle = objVrepairing.GetVehicle(cid); objVRepItem.ListVehicle = new List<VehicleItem>(); objVRepItem.ListVehicle.AddRange(lstVehicle); #endregion #region Bind DropDown Rtype List<clsMasterData> lstMasters1 = new List<clsMasterData>(); lstMasters1 = objVrepairing.GetRType(); objVRepItem.ListMaster = new List<clsMasterData>(); objVRepItem.ListMaster.AddRange(lstMasters1); #endregion ViewBag.Menuid = Request.QueryString["menuId"]; return View(objVRepItem); }
public ActionResult View(int id) { VehicleRepairingService objVService = new VehicleRepairingService(); VehicleRepairingItem objVItem = new VehicleRepairingItem(); objVItem = objVService.GetById(id); //Session["Empid"] = objPassItem.EmpId; List<VehicleRepairingItem> lstVehicle = new List<VehicleRepairingItem>(); objVItem.VehicleList = new List<VehicleRepairingItem>(); objVItem.VehicleList.AddRange(lstVehicle); int cid = 0; if (Session["CompID"] != null) { cid = Convert.ToInt32(Session["CompID"].ToString()); } #region Bind DropDown Comp List<CompanyItem> lstComp = new List<CompanyItem>(); VehicleRepairingService objVrepairing = new VehicleRepairingService(); //VehicleRepairingItem objVRepItem = new VehicleRepairingItem(); lstComp = objVrepairing.GetAllComp(); objVItem.ListComp = new List<CompanyItem>(); objVItem.ListComp.AddRange(lstComp); #endregion #region Bind DropDown Vehicle List<VehicleItem> lstVehicle1 = new List<VehicleItem>(); lstVehicle1 = objVrepairing.GetVehicle(cid); objVItem.ListVehicle = new List<VehicleItem>(); objVItem.ListVehicle.AddRange(lstVehicle1); #endregion #region Bind DropDown Rtype List<clsMasterData> lstMasters1 = new List<clsMasterData>(); lstMasters1 = objVrepairing.GetRType(); objVItem.ListMaster = new List<clsMasterData>(); objVItem.ListMaster.AddRange(lstMasters1); #endregion ViewBag.Menuid = Request.QueryString["menuId"]; return View(objVItem); }
public ActionResult delete(int id, int menuid) { try { //int Empid = Convert.ToInt32(Url.RequestContext.RouteData.Values["id"].ToString()); VehicleRepairingService objService = new VehicleRepairingService(); VehicleRepairingItem objDoc = new VehicleRepairingItem(); objDoc = objService.GetById(id); db.VehicleRepairings.Remove(db.VehicleRepairings.Find(id)); db.SaveChanges(); //ViewBag.Empid = Empid; ViewBag.Menuid = Request.QueryString["menuId"]; } catch (Exception ex) { //ViewBag.ErrorMsg = "First Delete This Tenancy No's All Documents. "; return View("Error"); } return RedirectToAction("Create", new { @id = id, @menuId = Request.QueryString["menuId"] }); }
public ActionResult Create() { //int Empid = Convert.ToInt32(Url.RequestContext.RouteData.Values["id"].ToString()); List <EmpInsuranceItem> lstInsu = new List <EmpInsuranceItem>(); EmpInsuranceService objInsu = new EmpInsuranceService(); //ViewBag.Empid = Empid; int cid = 0; string uid = null; if (Session["UserId"] != null) { uid = Session["UserId"].ToString(); } if (Session["CompID"] != null) { cid = Convert.ToInt32(Session["CompID"].ToString()); } lstInsu = objInsu.VehicleInsuranceList(cid); EmpInsuranceItem objEmpItem = new EmpInsuranceItem(); objEmpItem.ListInsurance = new List <EmpInsuranceItem>(); objEmpItem.ListInsurance.AddRange(lstInsu); VehicleRepairingService objVrepairing = new VehicleRepairingService(); #region Bind DropDown Vehicle List <VehicleItem> lstVehicle1 = new List <VehicleItem>(); lstVehicle1 = objVrepairing.GetVehicle(cid); objEmpItem.ListVehicle = new List <VehicleItem>(); objEmpItem.ListVehicle.AddRange(lstVehicle1); #endregion #region Bind DropDown Icomp List <clsMasterData> lstMasters = new List <clsMasterData>(); lstMasters = objInsu.GetALLIComp(); objEmpItem.ListMasterTable = new List <clsMasterData>(); objEmpItem.ListMasterTable.AddRange(lstMasters); #endregion #region Bind DropDown Ptype List <clsMasterData> lstMasters1 = new List <clsMasterData>(); lstMasters1 = objInsu.GetALLPType(); objEmpItem.ListPolicyType = new List <clsMasterData>(); objEmpItem.ListPolicyType.AddRange(lstMasters1); #endregion #region Bind DropDown Branch List <BranchItem> lstBranch = new List <BranchItem>(); lstBranch = objInsu.GetBranch(); objEmpItem.ListBranch = new List <BranchItem>(); objEmpItem.ListBranch.AddRange(lstBranch); #endregion #region Bind DropDown Comp List <CompanyItem> lstComp = new List <CompanyItem>(); lstComp = objInsu.GetComp(); objEmpItem.ListComp = new List <CompanyItem>(); objEmpItem.ListComp.AddRange(lstComp); #endregion #region Bind DropDown Emp List <EmployeeItem> lstEmp = new List <EmployeeItem>(); lstEmp = objInsu.GetEmp(); objEmpItem.ListEmp = new List <EmployeeItem>(); objEmpItem.ListEmp.AddRange(lstEmp); #endregion ViewBag.Menuid = Request.QueryString["menuId"]; return(View(objEmpItem)); }
public ActionResult View(int IID) { EmpInsuranceService objInsService = new EmpInsuranceService(); EmpInsuranceItem objInsItem = new EmpInsuranceItem(); objInsItem = objInsService.GetById(IID); //Session["Empid"] = objPassItem.EmpId; List <EmpInsuranceItem> lstInsu = new List <EmpInsuranceItem>(); objInsItem.ListInsurance = new List <EmpInsuranceItem>(); objInsItem.ListInsurance.AddRange(lstInsu); ViewBag.IID = IID; int cid = 0; if (Session["CompID"] != null) { cid = Convert.ToInt32(Session["CompID"].ToString()); } VehicleRepairingService objVrepairing = new VehicleRepairingService(); #region Bind DropDown Vehicle List <VehicleItem> lstVehicle1 = new List <VehicleItem>(); lstVehicle1 = objVrepairing.GetVehicle(cid); objInsItem.ListVehicle = new List <VehicleItem>(); objInsItem.ListVehicle.AddRange(lstVehicle1); #endregion #region Bind DropDown Icomp List <clsMasterData> lstMasters = new List <clsMasterData>(); lstMasters = objInsService.GetALLIComp(); objInsItem.ListMasterTable = new List <clsMasterData>(); objInsItem.ListMasterTable.AddRange(lstMasters); #endregion #region Bind DropDown Ptype lstMasters = objInsService.GetALLPType(); objInsItem.ListPolicyType = new List <clsMasterData>(); objInsItem.ListPolicyType.AddRange(lstMasters); #endregion #region Bind DropDown Branch List <BranchItem> lstBranch = new List <BranchItem>(); lstBranch = objInsService.GetBranch(); objInsItem.ListBranch = new List <BranchItem>(); objInsItem.ListBranch.AddRange(lstBranch); #endregion #region Bind DropDown Emp List <EmployeeItem> lstEmp = new List <EmployeeItem>(); lstEmp = objInsService.GetEmp(); objInsItem.ListEmp = new List <EmployeeItem>(); objInsItem.ListEmp.AddRange(lstEmp); #endregion #region Bind DropDown Comp List <CompanyItem> lstComp = new List <CompanyItem>(); lstComp = objInsService.GetComp(); objInsItem.ListComp = new List <CompanyItem>(); objInsItem.ListComp.AddRange(lstComp); #endregion ViewBag.Menuid = Request.QueryString["menuId"]; return(View(objInsItem)); }