protected void Button1_Click(object sender, EventArgs e) { HttpClient client = NitsAPI.apiConnection(); HttpResponseMessage response = client.GetAsync("imran").Result; ImranData imr = new ImranData(); imr.Name = txtname.Text; imr.Address = txtaddress.Text; imr.Phone = txtphone.Text; var x = client.PostAsJsonAsync("imran", imr).Result; if (response.IsSuccessStatusCode) { ImranData ds = new ImranData(); var data = response.Content.ReadAsAsync <IEnumerable <ImranData> >().Result; GridView1.DataSource = data; GridView1.DataBind(); loaddata(); txtname.Text = ""; txtaddress.Text = ""; txtphone.Text = ""; } else { GridView1.DataSource = null; GridView1.DataBind(); } }
protected void update_Click(object sender, EventArgs e) { HttpClient client = NitsAPI.apiConnection(); HttpResponseMessage response = client.GetAsync("imran").Result; ImranData imr = new ImranData(); imr.ID = Convert.ToInt64(Session["dd"].ToString()); imr.Name = txtname.Text; imr.Address = txtaddress.Text; imr.Phone = txtphone.Text; var x = client.PutAsJsonAsync("imran", imr).Result; if (response.IsSuccessStatusCode) { GridView1.DataSource = null; GridView1.DataBind(); loaddata(); txtname.Text = ""; txtaddress.Text = ""; txtphone.Text = ""; } else { //Label1.Text = "not updated"; } }
public List <StockItem> getStockItem() { HttpClient hc = NitsAPI.apiConnection1(); HttpResponseMessage response = hc.GetAsync("StockItem").Result; List <StockItem> SList = response.Content.ReadAsAsync <IEnumerable <StockItem> >().Result.ToList(); return(SList); }
//For DropDown Units public List <Unit> getUnits() { HttpClient http = NitsAPI.apiConnection1(); HttpResponseMessage response = http.GetAsync("unit").Result; List <Unit> model = response.Content.ReadAsAsync <List <Unit> >().Result.ToList(); return(model); }
public List <Section> GetSections(long Classid) { HttpClient hc = NitsAPI.apiConnection1(); HttpResponseMessage response = hc.GetAsync("Section/" + Classid).Result; List <Section> SList = response.Content.ReadAsAsync <IEnumerable <Section> >().Result.ToList(); return(SList); }
public List <OptionalSubjects> getAllOptionalSubjects(long classID) { HttpClient http = NitsAPI.apiConnection1(); HttpResponseMessage response = http.GetAsync("OptionalSubject/" + classID).Result; List <OptionalSubjects> model = response.Content.ReadAsAsync <List <OptionalSubjects> >().Result.ToList(); return(model); }
public User login(Login Lmodel) { HttpClient http = NitsAPI.apiConnection1(); HttpResponseMessage Response = http.PostAsJsonAsync("Login", Lmodel).Result; User UModel = Response.Content.ReadAsAsync <User>().Result; return(UModel); }
public List <Exam> getAllSubjects(long SubID) { HttpClient http = NitsAPI.apiConnection1(); HttpResponseMessage response = http.GetAsync("Subject/" + SubID).Result; List <Exam> model = response.Content.ReadAsAsync <IEnumerable <Exam> >().Result.ToList(); return(model); }
public Exam editSubject(Exam eModel) { HttpClient http = NitsAPI.apiConnection1(); HttpResponseMessage response = http.GetAsync("Subject/" + eModel.classID).Result; List <Exam> Listmodel = response.Content.ReadAsAsync <IEnumerable <Exam> >().Result.ToList(); Exam model = Listmodel.FirstOrDefault(x => x.subjectID == eModel.subjectID); return(model); }
public List <Student> getStudents(long classID, long sectionID) { HttpClient http = NitsAPI.apiConnection1(); HttpResponseMessage response = http.GetAsync("student/" + classID + "/" + sectionID).Result; List <Student> model = response.Content.ReadAsAsync <IEnumerable <Student> >().Result.ToList(); return(model); }
/// <summary> /// /// </summary> /// edit section angain changed /// <returns></returns> public Section EditSectin(long SectionID) { HttpClient hc = NitsAPI.apiConnection1(); HttpResponseMessage response = hc.GetAsync("SectionEdit/" + SectionID).Result; Section SecModel = response.Content.ReadAsAsync <Section>().Result; return(SecModel); }
public Result getRecord(Result reModel) { HttpClient http = NitsAPI.apiConnection1(); HttpResponseMessage response = http.GetAsync("maxmarks/" + "/" + reModel.classid + "/" + reModel.unitid + "/" + reModel.subjectid).Result; Result model = response.Content.ReadAsAsync <Result>().Result; return(model); }
public List <Marks> getAwardRoll(long classID, long SectionId, long UnitId, long SubjectId, long type) { HttpClient http = NitsAPI.apiConnection1(); HttpResponseMessage response = http.GetAsync("marks/" + classID + "/" + SectionId + "/" + UnitId + "/" + SubjectId).Result; List <Marks> model = response.Content.ReadAsAsync <IEnumerable <Marks> >().Result.ToList(); return(model); }
public StockItem EditStockItem(long ItemID) { HttpClient hc = NitsAPI.apiConnection1(); HttpResponseMessage response = hc.GetAsync("StockItem/" + ItemID).Result; StockItem StmModel = response.Content.ReadAsAsync <StockItem>().Result; return(StmModel); }
//For Edit Marks public List <Marks> getAwardRoll(Marks mModel) { HttpClient http = NitsAPI.apiConnection1(); HttpResponseMessage response = http.GetAsync("marks/" + mModel.classID + "/" + mModel.sectionID + "/" + mModel.unitID + "/" + mModel.subjectID).Result; List <Marks> model = response.Content.ReadAsAsync <IEnumerable <Marks> >().Result.ToList(); return(model); }
//Fill Grid Subjects public List <Result> getAllSubjects(long classId) { HttpClient http = NitsAPI.apiConnection1(); HttpResponseMessage response = http.GetAsync("maxmarks/" + "/" + classId).Result; List <Result> model = response.Content.ReadAsAsync <IEnumerable <Result> >().Result.ToList(); model = model.Where(x => x.classid == classId).ToList(); return(model); }
public List <Award> getStudentsSubjects(long sectionId, long unitId, long studentId, long type) { HttpClient http = NitsAPI.apiConnection1(); HttpResponseMessage response = http.GetAsync("award/" + sectionId + "/" + unitId + "/" + studentId + "/" + type).Result; List <Award> model = response.Content.ReadAsAsync <IEnumerable <Award> >().Result.ToList(); return(model); }
// Get Min Max Marks On Basis Of ClassID, UnitId,SectionID public Result fillLabels(Result reModel) { HttpClient http = NitsAPI.apiConnection1(); HttpResponseMessage response = http.GetAsync("maxmarks/" + reModel.classid + "/" + reModel.unitid + "/" + reModel.subjectid).Result; Result model = response.Content.ReadAsAsync <Result>().Result; //model = model.Where(x => x.unitid == reModel.unitid).ToList(); return(model); }
// Fill Grid Units public List <Result> getAllMinMaxResults(Result reModel) { HttpClient http = NitsAPI.apiConnection1(); HttpResponseMessage response = http.GetAsync("maxmarks/" + reModel.classid + "/" + reModel.unitid).Result; List <Result> model = response.Content.ReadAsAsync <IEnumerable <Result> >().Result.ToList(); model = model.Where(x => x.unitid == reModel.unitid).ToList(); return(model); }
public ClassModel EditClass(long ClassId) { HttpClient hc = NitsAPI.apiConnection1(); HttpResponseMessage response = hc.GetAsync("class").Result; List <ClassModel> CList = response.Content.ReadAsAsync <IEnumerable <ClassModel> >().Result.ToList(); ClassModel cmodel = CList.FirstOrDefault(x => x.ClassId == ClassId); return(cmodel); }
public List <ClassModel> getAllClasses(string Current_Session) { HttpClient hc = NitsAPI.apiConnection1(); HttpResponseMessage response = hc.GetAsync("class/" + Current_Session).Result; List <ClassModel> CList = response.Content.ReadAsAsync <IEnumerable <ClassModel> >().Result.ToList(); return(CList); }
public OptionalSubjects editOptionalSubject(OptionalSubjects eModel) { HttpClient http = NitsAPI.apiConnection1(); HttpResponseMessage response = http.GetAsync("OptionalSubject/" + eModel.classID).Result; List <OptionalSubjects> Listmodel = response.Content.ReadAsAsync <IEnumerable <OptionalSubjects> >().Result.ToList(); OptionalSubjects model = Listmodel.FirstOrDefault(x => x.optionalSubjectID == eModel.optionalSubjectID); return(model); }
public string addMarks(List <Marks> lModel) { HttpClient http = NitsAPI.apiConnection1(); var ReturnMessage = http.PostAsJsonAsync("marks/", lModel).Result; if (ReturnMessage.IsSuccessStatusCode) { return(ReturnMessage.Content.ReadAsAsync <string>().Result); } else { return(ReturnMessage.Content.ReadAsAsync <string>().Result); } }
public string DeleteClass(long ClassId) { HttpClient http = NitsAPI.apiConnection1(); var ReturnMessage = http.DeleteAsync("Class/" + ClassId.ToString()).Result; if (ReturnMessage.IsSuccessStatusCode) { return(ReturnMessage.Content.ReadAsAsync <string>().Result); } else { return(ReturnMessage.Content.ReadAsAsync <string>().Result); } }
public string AddClass(ClassModel model) { HttpClient http = NitsAPI.apiConnection1(); var ReturnMessage = http.PostAsJsonAsync("class", model).Result; if (ReturnMessage.IsSuccessStatusCode) { return(ReturnMessage.Content.ReadAsAsync <string>().Result); } else { return(ReturnMessage.Content.ReadAsAsync <string>().Result); } }
public string addOptionalSubject(OptionalSubjects model) { HttpClient http = NitsAPI.apiConnection1(); var ReturnMessage = http.PostAsJsonAsync("OptionalSubject/" + model.classID, model).Result; if (ReturnMessage.IsSuccessStatusCode) { return(ReturnMessage.Content.ReadAsAsync <string>().Result); } else { return(ReturnMessage.Content.ReadAsAsync <string>().Result); } }
public string DeleteStockItem(long ItemID) { HttpClient http = NitsAPI.apiConnection1(); var ReturnMessage = http.DeleteAsync("StockItem/" + ItemID.ToString()).Result; if (ReturnMessage.IsSuccessStatusCode) { return(ReturnMessage.Content.ReadAsAsync <string>().Result); } else { return(ReturnMessage.Content.ReadAsAsync <string>().Result); } }
public string deleteOptionalSubject(long subjectID) { HttpClient http = NitsAPI.apiConnection1(); var ReturnMessage = http.DeleteAsync("OptionalSubject/" + subjectID.ToString()).Result; if (ReturnMessage.IsSuccessStatusCode) { return(ReturnMessage.Content.ReadAsAsync <string>().Result); } else { return(ReturnMessage.Content.ReadAsAsync <string>().Result); } }
public string addSubject(Exam Emodel) { HttpClient http = NitsAPI.apiConnection1(); var ReturnMessage = http.PostAsJsonAsync("Subject/" + Emodel.subjectID, Emodel).Result; if (ReturnMessage.IsSuccessStatusCode) { return(ReturnMessage.Content.ReadAsAsync <string>().Result); } else { return(ReturnMessage.Content.ReadAsAsync <string>().Result); } }
public string updateIndividualStudentMarks(List <Marks> Emodel, long ClassId, long SectionId, long UnitId, long StudentId) { HttpClient http = NitsAPI.apiConnection1(); var ReturnMessage = http.PostAsJsonAsync("marks/", Emodel).Result; if (ReturnMessage.IsSuccessStatusCode) { return(ReturnMessage.Content.ReadAsAsync <string>().Result); } else { return(ReturnMessage.Content.ReadAsAsync <string>().Result); } }