public ActionResult EditMarketingExecutive(string id) { HttpCookie rxgoadmin = Request.Cookies["rxgoAdmin"]; string adminid = rxgoadmin.Values["Hid"]; List <MarketingExecutive> ExecutiveList = new List <MarketingExecutive>(); Property p = new Property(); DataSet ds = new DataSet(); p.OnTable = "FetchExecutive"; if (id != null) { p.Condition1 = id; } if (adminid != null) { p.Condition2 = adminid; } ds = dl.FetchMarketingExecutive_sp(p); List <SelectListItem> CountryList = new List <SelectListItem>(); CountryList.Add(new SelectListItem { Text = "Select Country", Value = "" }); foreach (DataRow dr in ds.Tables[2].Rows) { CountryList.Add(new SelectListItem { Text = dr["CountryName"].ToString(), Value = dr["CountryId"].ToString() }); } ViewBag.CountryList = new SelectList(CountryList, "Value", "Text"); MarketingExecutive info = new RXGOADMIN.Models.MarketingExecutive(); try { info = new RXGOADMIN.Models.MarketingExecutive() { ExecutiveId = ds.Tables[1].Rows[0]["ExecutiveId"].ToString(), ExecutiveName = ds.Tables[1].Rows[0]["ExecutiveName"].ToString(), ExecutivePhone = ds.Tables[1].Rows[0]["ExecutivePhone"].ToString(), ExecutiveEmail = enc.Decrypt(ds.Tables[1].Rows[0]["ExecutiveEmail"].ToString()), Password = enc.Decrypt(ds.Tables[1].Rows[0]["Password"].ToString()), ExecutiveAddress = ds.Tables[1].Rows[0]["ExecutiveAddress"].ToString(), ExecutiveAge = ds.Tables[1].Rows[0]["ExecutiveAge"].ToString(), CountryName = ds.Tables[1].Rows[0]["CountryName"].ToString(), StateName = ds.Tables[1].Rows[0]["StateName"].ToString(), CityName = ds.Tables[1].Rows[0]["CityName"].ToString(), CountryId = ds.Tables[1].Rows[0]["CountryId"].ToString(), StateId = ds.Tables[1].Rows[0]["StateId"].ToString(), CityId = ds.Tables[1].Rows[0]["CityId"].ToString() }; } catch (Exception ex) { } return(PartialView(info)); }
// GET: api/ExecutiveProfileShowApi/5 public IHttpActionResult Get(string id) { //List<MarketingExecutive> ExecutiveList = new List<MarketingExecutive>(); Property p = new Property(); DataSet ds = new DataSet(); p.Condition1 = id; p.OnTable = "ShowProfile"; ds = dl.Fetch_API_Executive(p); MarketingExecutive info = new RXGOADMIN.Models.MarketingExecutive(); try { info = new RXGOADMIN.Models.MarketingExecutive() { ExecutiveId = ds.Tables[0].Rows[0]["ExecutiveId"].ToString(), ExecutiveName = ds.Tables[0].Rows[0]["ExecutiveName"].ToString(), ExecutiveEmail = enc.Decrypt(ds.Tables[0].Rows[0]["ExecutiveEmail"].ToString()), ExecutivePhone = ds.Tables[0].Rows[0]["ExecutivePhone"].ToString(), ExecutiveAge = ds.Tables[0].Rows[0]["ExecutiveAge"].ToString(), ExecutiveAddress = ds.Tables[0].Rows[0]["ExecutiveAddress"].ToString(), CountryId = ds.Tables[0].Rows[0]["CountryId"].ToString(), CountryName = ds.Tables[0].Rows[0]["CountryName"].ToString(), StateId = ds.Tables[0].Rows[0]["StateId"].ToString(), StateName = ds.Tables[0].Rows[0]["StateName"].ToString(), CityId = ds.Tables[0].Rows[0]["CityId"].ToString(), CityName = ds.Tables[0].Rows[0]["CityName"].ToString(), AdminId = ds.Tables[0].Rows[0]["AdminId"].ToString(), Password = enc.Decrypt(ds.Tables[0].Rows[0]["Password"].ToString()), IsActive = ds.Tables[0].Rows[0]["IsActive"].ToString(), }; } catch (Exception ex) { return(NotFound()); } return(Ok(info)); }