public ActionResult Edit(int id) { objTenancyService = new TenancyService(); objTenancyItem = new TenancyItem(); // string strid = objTenancyService.Decrypt(id.ToString()); //string strid = id.ToString(); //int Tid = Convert.ToInt32(strid); objTenancyItem = objTenancyService.GetByid(id); //CompanyBind List <CompanyItem> lstCompany = new List <CompanyItem>(); lstCompany = objTenancyService.GetCompany(); objTenancyItem.ListCompany = new List <CompanyItem>(); objTenancyItem.ListCompany.AddRange(lstCompany); //Employee Bind List <EmployeeItem> lstEmp = new List <EmployeeItem>(); lstEmp = objTenancyService.GetEmployee(); objTenancyItem.ListEmployee = new List <EmployeeItem>(); objTenancyItem.ListEmployee.AddRange(lstEmp); // ListGrid bind List <TenancyItem> ListTenancy = new List <TenancyItem>(); ListTenancy = objTenancyService.getTenancyDoc(id); objTenancyItem.ListTenancy = new List <TenancyItem>(); objTenancyItem.ListTenancy.AddRange(ListTenancy); //TenancyType List <clsMasterData> lstTT = new List <clsMasterData>(); lstTT = objTenancyService.GetTenancyType(); objTenancyItem.ListTT = new List <clsMasterData>(); objTenancyItem.ListTT.AddRange(lstTT); //ViewBag.Menuid = objTenancyService.Decrypt(Request.QueryString["menuid"]); ViewBag.Menuid = (Request.QueryString["menuid"]); return(View(objTenancyItem)); }
public ActionResult Create() { objTenancyService = new TenancyService(); objTenancyItem = new TenancyItem(); //CompanyBind List <CompanyItem> lstCompany = new List <CompanyItem>(); lstCompany = objTenancyService.GetCompany(); objTenancyItem.ListCompany = new List <CompanyItem>(); objTenancyItem.ListCompany.AddRange(lstCompany); //Employee Bind List <EmployeeItem> lstEmp = new List <EmployeeItem>(); lstEmp = objTenancyService.GetEmployee(); objTenancyItem.ListEmployee = new List <EmployeeItem>(); objTenancyItem.ListEmployee.AddRange(lstEmp); // ListGrid bind int cid = 0; if (Session["CompID"] != null) { cid = Convert.ToInt32(Session["CompID"].ToString()); } List <TenancyItem> ListTenancy = new List <TenancyItem>(); ListTenancy = objTenancyService.GetAll(cid); objTenancyItem.ListTenancy = new List <TenancyItem>(); // objTenancyItem.ListTenancy.Add(new TenancyItem{TnID=Encrypt(ListTenancy)}) objTenancyItem.ListTenancy.AddRange(ListTenancy); //TenancyType List <clsMasterData> lstTT = new List <clsMasterData>(); lstTT = objTenancyService.GetTenancyType(); objTenancyItem.ListTT = new List <clsMasterData>(); objTenancyItem.ListTT.AddRange(lstTT); ViewBag.Menuid = (Request.QueryString["menuid"]); return(View(objTenancyItem)); }