public ActionResult View(int id) { OtherExpService objOExp = new OtherExpService(); PartyServices objParty = new PartyServices(); PartyModel objpartyItem = new PartyModel(); List <PartyModel> lstparty = new List <PartyModel>(); int cid = 0; if (Session["CompID"] != null) { cid = Convert.ToInt32(Session["CompID"].ToString()); } objpartyItem = objParty.GetById(id); objpartyItem.ListParty = new List <PartyModel>(); objpartyItem.ListParty.AddRange(lstparty); #region Bind DropDown Comp List <CompanyItem> lstComp = new List <CompanyItem>(); lstComp = objOExp.GetAllComp(); objpartyItem.CompanyList = new List <CompanyItem>(); objpartyItem.CompanyList.AddRange(lstComp); #endregion #region Bind DropDown Party lstparty = objParty.BindParentParty(cid, id); objpartyItem.ListPartyDrp = new List <PartyModel>(); objpartyItem.ListPartyDrp.AddRange(lstparty); #endregion return(View(objpartyItem)); }
public ActionResult Create() { List <OtherExpItem> lstOExp = new List <OtherExpItem>(); int cid = 0; if (Session["CompID"] != null) { cid = Convert.ToInt32(Session["CompID"].ToString()); } OtherExpService objOExp = new OtherExpService(); lstOExp = objOExp.OtherExpData(cid); OtherExpItem objOExpItem = new OtherExpItem(); objOExpItem.ListOExp = new List <OtherExpItem>(); objOExpItem.ListOExp.AddRange(lstOExp); #region Bind DropDown Comp List <CompanyItem> lstComp = new List <CompanyItem>(); lstComp = objOExp.GetAllComp(); objOExpItem.ListComp = new List <CompanyItem>(); objOExpItem.ListComp.AddRange(lstComp); #endregion #region Bind DropDown Emp List <EmployeeItem> lstEmp = new List <EmployeeItem>(); lstEmp = objOExp.GetEmp(); objOExpItem.ListEmp = new List <EmployeeItem>(); objOExpItem.ListEmp.AddRange(lstEmp); #endregion #region Bind DropDown Branch List <BranchItem> lstBranch = new List <BranchItem>(); lstBranch = objOExp.GetBranch(); objOExpItem.ListBranch = new List <BranchItem>(); objOExpItem.ListBranch.AddRange(lstBranch); #endregion #region Bind DropDown Exp List <clsMasterData> lstMasters1 = new List <clsMasterData>(); lstMasters1 = objOExp.GetExp(); objOExpItem.ListMaster = new List <clsMasterData>(); objOExpItem.ListMaster.AddRange(lstMasters1); #endregion ViewBag.Menuid = Request.QueryString["menuId"]; return(View(objOExpItem)); }
public ActionResult Edit(OtherExpItem model) { OtherExpService objTExp = new OtherExpService(); string uid = null; if (Session["UserId"] != null) { uid = Session["UserId"].ToString(); } model.UpdateBy = uid; model.UpdatedDate = System.DateTime.Now; objTExp.Update(model); return(RedirectToAction("Create", new { @menuId = model.Viewbagidformenu })); }
public ActionResult delete(int id, int menuid) { try { //int Empid = Convert.ToInt32(Url.RequestContext.RouteData.Values["id"].ToString()); OtherExpService objTenService = new OtherExpService(); OtherExpItem objDoc = new OtherExpItem(); objDoc = objTenService.GetById(id); db.Other_Expenses.Remove(db.Other_Expenses.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 { @menuId = Request.QueryString["menuId"] })); }
public ActionResult View(int id) { OtherExpService objOExpService = new OtherExpService(); OtherExpItem objOExpItem = new OtherExpItem(); objOExpItem = objOExpService.GetById(id); List <OtherExpItem> lstVehicle = new List <OtherExpItem>(); objOExpItem.ListOExp = new List <OtherExpItem>(); objOExpItem.ListOExp.AddRange(lstVehicle); #region Bind DropDown Comp List <CompanyItem> lstComp = new List <CompanyItem>(); lstComp = objOExpService.GetAllComp(); objOExpItem.ListComp = new List <CompanyItem>(); objOExpItem.ListComp.AddRange(lstComp); #endregion #region Bind DropDown Emp List <EmployeeItem> lstEmp = new List <EmployeeItem>(); lstEmp = objOExpService.GetEmp(); objOExpItem.ListEmp = new List <EmployeeItem>(); objOExpItem.ListEmp.AddRange(lstEmp); #endregion #region Bind DropDown Branch List <BranchItem> lstBranch = new List <BranchItem>(); lstBranch = objOExpService.GetBranch(); objOExpItem.ListBranch = new List <BranchItem>(); objOExpItem.ListBranch.AddRange(lstBranch); #endregion #region Bind DropDown Exp List <clsMasterData> lstMasters1 = new List <clsMasterData>(); lstMasters1 = objOExpService.GetExp(); objOExpItem.ListMaster = new List <clsMasterData>(); objOExpItem.ListMaster.AddRange(lstMasters1); #endregion ViewBag.Menuid = Request.QueryString["menuId"]; return(View(objOExpItem)); }
public ActionResult Create() { int cid = 0; if (Session["CompID"] != null) { cid = Convert.ToInt32(Session["CompID"].ToString()); } List <CompanyItem> lstComp = new List <CompanyItem>(); List <PartyModel> lstparty1 = new List <PartyModel>(); OtherExpService objOExp = new OtherExpService(); PartyModel objParty = new PartyModel(); PartyServices objPartys = new PartyServices(); objParty.ListParty = new List <PartyModel>(); lstparty1 = objPartys.bindList(cid); objParty.ListParty = new List <PartyModel>(); objParty.ListParty.AddRange(lstparty1); #region Bind DropDown Comp List <PartyModel> lstparty = new List <PartyModel>(); lstComp = objOExp.GetAllComp(); objParty.CompanyList = new List <CompanyItem>(); objParty.CompanyList.AddRange(lstComp); #endregion #region Bind DropDown Party lstparty = objPartys.BindParentPartyAll(cid); objParty.ListPartyDrp = new List <PartyModel>(); objParty.ListPartyDrp.AddRange(lstparty); #endregion ViewBag.Menuid = (Request.QueryString["menuid"]); return(View(objParty)); }
public ActionResult Create(OtherExpItem model) { OtherExpService objTExp = new OtherExpService(); int cid = 0; if (Session["CompID"] != null) { cid = Convert.ToInt32(Session["CompID"].ToString()); } if (model.CompID == null) { model.CompID = cid; } string uid = null; if (Session["UserId"] != null) { uid = Session["UserId"].ToString(); } model.CreatedBy = uid; model.CreatedDate = System.DateTime.Now; objTExp.Insert(model); return(RedirectToAction("Create", new { @menuId = model.Viewbagidformenu })); }