Exemple #1
0
 public static void HobiEkle(HobiView h, string userName)
 {
     try
     {
         using (CheckinDatasetEntities4 db = new CheckinDatasetEntities4())
         {
             var UserLogID = (from p in db.UserLoginInfo
                              where p.USERNAME == userName
                              select p.USERLOGINID).FirstOrDefault();
             besPuanEkle(h.besPuan, UserLogID);
             dortPuanEkle(h.dortPuan, UserLogID);
             ucPuanEkle(h.ucPuan, UserLogID);
             ikiPuanEkle(h.ikiPuan, UserLogID);
             birPuanEkle(h.birPuan, UserLogID);
             sifirPuanEkle(h.sifirPuan, UserLogID);
         }
     }
     catch (System.Data.Entity.Validation.DbEntityValidationException dbEx)
     {
         Exception raise = dbEx;
         foreach (var validationErrors in dbEx.EntityValidationErrors)
         {
             foreach (var validationError in validationErrors.ValidationErrors)
             {
                 string message = string.Format("{0}:{1}",
                                                validationErrors.Entry.Entity.ToString(),
                                                validationError.ErrorMessage);
                 // raise a new exception nesting
                 // the current instance as InnerException
                 raise = new InvalidOperationException(message, raise);
             }
         }
         throw raise;
     }
 }
Exemple #2
0
 public JsonResult HobiEkle(HobiView h)
 {
     BL.BL.HobiEkle(h, User.Identity.Name);
     return(Json(true));
 }