예제 #1
0
        public HttpResponseMessage Put(int id, [FromBody] EduCourse educourse)
        {
            try
            {
                using (TrustyloandbEntities entities = new TrustyloandbEntities())
                {
                    var entity = entities.EduCourses.FirstOrDefault(e => e.P_ID == id);
                    if (entity == null)
                    {
                        return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "Person with P_Id " + id.ToString() + " Not Found!"));
                    }
                    else
                    {
                        entity.St_Ssc_Inst         = educourse.St_Ssc_Inst;
                        entity.St_Ssc_Year         = educourse.St_Ssc_Year;
                        entity.St_Ssc_Per          = educourse.St_Ssc_Per;
                        entity.St_Ssc_Class        = educourse.St_Ssc_Class;
                        entity.St_Ssc_Money_Won    = educourse.St_Ssc_Money_Won;
                        entity.St_Hsc_Inst         = educourse.St_Hsc_Inst;
                        entity.St_Hsc_Year         = educourse.St_Hsc_Year;
                        entity.St_Hsc_Per          = educourse.St_Hsc_Per;
                        entity.St_Hsc_Class        = educourse.St_Hsc_Class;
                        entity.St_Hsc_Money_Won    = educourse.St_Hsc_Money_Won;
                        entity.St_LD_Inst          = educourse.St_LD_Inst;
                        entity.St_LD_Year          = educourse.St_LD_Year;
                        entity.St_LD_Per           = educourse.St_LD_Per;
                        entity.St_LD_Class         = educourse.St_LD_Class;
                        entity.St_LD_Money_Won     = educourse.St_LD_Money_Won;
                        entity.St_Exam_Score       = educourse.St_Exam_Score;
                        entity.St_College_Details  = educourse.St_College_Details;
                        entity.St_City             = educourse.St_City;
                        entity.St_State            = educourse.St_State;
                        entity.St_District         = educourse.St_District;
                        entity.St_Pin_Code         = educourse.St_Pin_Code;
                        entity.St_Country          = educourse.St_Country;
                        entity.St_Admission_Status = educourse.St_Admission_Status;
                        entity.St_Univ_Name        = educourse.St_Univ_Name;
                        entity.St_Univ_Person      = educourse.St_Univ_Person;
                        entity.St_Course_Name      = educourse.St_Course_Name;
                        entity.St_Course_Appr      = educourse.St_Course_Appr;
                        entity.St_Admsn            = educourse.St_Admsn;
                        entity.St_Course_Cat       = educourse.St_Course_Cat;
                        entity.St_Course_Type      = educourse.St_Course_Type;
                        entity.St_Course_Start     = educourse.St_Course_Start;
                        entity.St_Course_End       = educourse.St_Course_End;
                        entity.St_Morat1           = educourse.St_Morat1;
                        entity.St_Morat2           = educourse.St_Morat2;
                        entity.St_Total_Morat      = educourse.St_Total_Morat;
                        entity.St_Emi_Repay        = educourse.St_Emi_Repay;
                        entity.St_Loan_Period      = educourse.St_Loan_Period;
                        entity.St_Int_Serv         = educourse.St_Int_Serv;
                        entity.St_Exp_Income       = educourse.St_Exp_Income;
                        entity.St_Clg_Name         = educourse.St_Clg_Name;
                        entity.St_Course_Persuid   = educourse.St_Course_Persuid;
                        entity.St_Compl_Date       = educourse.St_Compl_Date;

                        entities.SaveChanges();

                        return(Request.CreateResponse(HttpStatusCode.OK));
                    }
                }
            }
            catch (Exception ex)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex));
            }
        }
예제 #2
0
        public HttpResponseMessage Put(int id, [FromBody] GoldAppDoc goldappdoc)
        {
            try
            {
                using (TrustyloandbEntities entities = new TrustyloandbEntities())
                {
                    var entity = entities.GoldAppDocs.FirstOrDefault(e => e.P_ID == id);
                    if (entity == null)
                    {
                        return Request.CreateErrorResponse(HttpStatusCode.NotFound, "Person with P_Id " + id.ToString() + " Not Found!");
                    }
                    else
                    {
                        entity.Doc1_Name = goldappdoc.Doc1_Name;
                        entity.Doc1 = goldappdoc.Doc1;
                        entity.Doc2_Name = goldappdoc.Doc2_Name;
                        entity.Doc2 = goldappdoc.Doc2;
                        entity.Doc3_Name = goldappdoc.Doc3_Name;
                        entity.Doc3 = goldappdoc.Doc3;
                        entity.Doc4_Name = goldappdoc.Doc4_Name;
                        entity.Doc4 = goldappdoc.Doc4;
                        entity.Doc5_Name = goldappdoc.Doc5_Name;
                        entity.Doc5 = goldappdoc.Doc5;
                        entity.Doc6_Name = goldappdoc.Doc6_Name;
                        entity.Doc6 = goldappdoc.Doc6;
                        entity.Doc7_Name = goldappdoc.Doc7_Name;
                        entity.Doc7 = goldappdoc.Doc7;
                        entity.Doc8_Name = goldappdoc.Doc8_Name;
                        entity.Doc8 = goldappdoc.Doc8;
                        entity.Doc9_Name = goldappdoc.Doc9_Name;
                        entity.Doc9 = goldappdoc.Doc9;
                        entity.Doc10_Name = goldappdoc.Doc10_Name;
                        entity.Doc10 = goldappdoc.Doc10;
                        entity.Doc11_Name = goldappdoc.Doc11_Name;
                        entity.Doc11 = goldappdoc.Doc11;
                        entity.Doc12_Name = goldappdoc.Doc12_Name;
                        entity.Doc12 = goldappdoc.Doc12;
                        entity.Doc13_Name = goldappdoc.Doc13_Name;
                        entity.Doc13 = goldappdoc.Doc13;
                        entity.Doc14_Name = goldappdoc.Doc14_Name;
                        entity.Doc14 = goldappdoc.Doc14;
                        entity.Doc15_Name = goldappdoc.Doc15_Name;
                        entity.Doc15 = goldappdoc.Doc15;
                        entity.Doc16_Name = goldappdoc.Doc16_Name;
                        entity.Doc16 = goldappdoc.Doc16;
                        entity.Doc17_Name = goldappdoc.Doc17_Name;
                        entity.Doc17 = goldappdoc.Doc17;
                        entity.Doc18_Name = goldappdoc.Doc18_Name;
                        entity.Doc18 = goldappdoc.Doc18;
                        entity.Doc19_Name = goldappdoc.Doc19_Name;
                        entity.Doc19 = goldappdoc.Doc19;
                        entity.Doc20_Name = goldappdoc.Doc20_Name;
                        entity.Doc20 = goldappdoc.Doc20;

                        entities.SaveChanges();

                        return Request.CreateResponse(HttpStatusCode.OK);
                    }
                }
            }
            catch (Exception ex)
            {
                return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex);
            }
        }