Exemple #1
0
    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();
        }
    }
Exemple #2
0
    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";
        }
    }
Exemple #3
0
    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);
    }
Exemple #4
0
        //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);
        }
Exemple #5
0
        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);
        }
Exemple #6
0
        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);
        }
Exemple #7
0
        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);
        }
Exemple #8
0
        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);
        }
Exemple #9
0
        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);
        }
Exemple #10
0
        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);
        }
Exemple #11
0
        /// <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);
        }
Exemple #12
0
        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);
        }
Exemple #13
0
        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);
        }
Exemple #14
0
    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);
    }
Exemple #15
0
        //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);
        }
Exemple #16
0
        //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);
        }
Exemple #17
0
        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);
        }
Exemple #18
0
        // 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);
        }
Exemple #19
0
        // 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);
        }
Exemple #20
0
        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);
        }
Exemple #21
0
        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);
        }
Exemple #22
0
        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);
        }
Exemple #23
0
        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);
            }
        }
Exemple #24
0
        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);
            }
        }
Exemple #25
0
        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);
            }
        }
Exemple #26
0
        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);
            }
        }
Exemple #27
0
    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);
        }
    }
Exemple #28
0
        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);
            }
        }
Exemple #29
0
        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);
            }
        }
Exemple #30
0
        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);
            }
        }