public ActionResult enginners_listByID(EngineerDetails a) { EngineersD responce = new EngineersD(); try { string query = "EXEC spEngineers '" + a.Id + "','','','','','','SelectById'"; DataSet ds = d.BindDataset(query); List <EngineerDetails> lste = new List <EngineerDetails>(); if (ds.Tables[0].Rows.Count > 0) { EngineerDetails v = new EngineerDetails(); v.Id = int.Parse(ds.Tables[0].Rows[0]["Id"].ToString()); v.e_name = ds.Tables[0].Rows[0]["Engineer Name"].ToString(); v.contact = ds.Tables[0].Rows[0]["Phone Number"].ToString(); v.gender_id = int.Parse(ds.Tables[0].Rows[0]["GenderId"].ToString()); v.gender = ds.Tables[0].Rows[0]["Gender"].ToString(); v.Exp_id = int.Parse(ds.Tables[0].Rows[0]["ExpId"].ToString()); v.E_Experience = ds.Tables[0].Rows[0]["Experience"].ToString(); v.D_OF_J = ds.Tables[0].Rows[0]["D_OF_J"].ToString(); lste.Add(v); responce.data = lste; responce.Description = "Data Found"; } } catch (Exception e) { responce.Description = e.Message; } return(Json(responce)); }
public virtual ActionResult LiveHelp() { EngineerDetails engineerDetails = new EngineerDetails(); List <Engineer> engineerNamesList = engineerDetails.findOnlineEngineers(); ViewBag.ApiBaseUrl = ConfigurationSettings.AppSettings["ApiBaseUrl"]; return(View(engineerNamesList)); }
public ActionResult Delete_enginners(EngineerDetails a) { EngineersD responce = new EngineersD(); try { string query = "EXEC spEngineers '" + a.Id + "','','','','','','Delete'"; DataSet ds = d.BindDataset(query); if (ds.Tables[0].Rows.Count > 0) { responce.Description = ds.Tables[0].Rows[0][0].ToString(); } } catch (Exception e) { responce.Description = e.Message; } return(Json(responce)); }
public ActionResult Add_enginners(EngineerDetails en) { EngineersD responce = new EngineersD(); try { string query = "Exec spEngineers '','" + en.e_name + "','" + en.contact + "','" + en.gender_id + "','" + en.Exp_id + "','" + en.D_OF_J + "','Insert'"; DataSet ds = d.BindDataset(query); if (ds.Tables[0].Rows.Count > 0) { responce.Description = ds.Tables[0].Rows[0][0].ToString(); if (responce.Description == "OK") { responce.Description = "Engineer Added Successfully"; } } } catch (Exception e) { responce.Description = e.Message; } return(Json(responce)); }