public IActionResult Post(RequestData <Customers> data)
 {
     konteks.Customer.Add(data.Dataa.Attributes);
     if (data.Dataa.Attributes.sex == "male")
     {
         data.Dataa.Attributes.gender = kelamin.male;
     }
     else if (data.Dataa.Attributes.sex == "female")
     {
         data.Dataa.Attributes.gender = kelamin.female;
     }
     konteks.SaveChanges();
     return(Ok());
 }
 public static void RemoveRoomReservationToDb(ROOM_RESERVATIONS model)
 {
     using (var context = new Contextt())
     {
         context.RoomReservationContext.Remove(model);
         context.SaveChanges();
     };
 }
 public static void AddProjectEmployeeToDB(PROJECT_EMPLOYEES model)
 {
     using (var context = new Contextt())
     {
         context.ProjectEmployeeContext.Add(model);
         context.SaveChanges();
     };
 }
 public static void RemoveEmployeeReservationFromDB(PROJECT_EMPLOYEES_RESERVATION model)
 {
     using (var context = new Contextt())
     {
         context.ProjectEmployeeReservationContext.Remove(model);
         context.SaveChanges();
     };
 }
 public static void RemoveResourceReservationFromDB(RESOURCES_RESERVATIONS model)
 {
     using (var context = new Contextt())
     {
         context.ResourceReservationContext.Remove(model);
         context.SaveChanges();
     };
 }
 public static void AddResourceToDB(RESOURCES model)
 {
     using (var context = new Contextt())
     {
         context.ResourceContext.Add(model);
         context.SaveChanges();
     };
 }
 public static void AddProjectToDB(PROJECTS model)
 {
     using (var context = new Contextt())
     {
         context.ProjectContext.Add(model);
         context.SaveChanges();
     };
 }
 public ActionResult DeleteRoomReservation()
 {
     using (var context = new Contextt())
     {
         context.RoomReservationContext.Attach(_roomReservation);
         context.RoomReservationContext.Remove(_roomReservation);
         context.SaveChanges();
     };
     return(RedirectToAction("ProjectList"));
 }
 public ActionResult DeleteEmployeeReservation()
 {
     using (var context = new Contextt())
     {
         context.ProjectEmployeeReservationContext.Attach(_reservation);
         context.ProjectEmployeeReservationContext.Remove(_reservation);
         context.SaveChanges();
     };
     return(RedirectToAction("Index"));
 }
Beispiel #10
0
        public bool Login(string email, string pass)
        {
            var  list    = _ctx.Users.ToList();
            bool founded = false;

            for (int i = 0; i < list.Count(); i++)
            {
                if (list[i].Email == email)
                {
                    if (list[i].Password == pass)
                    {
                        founded           = true;
                        list[i].LastLogin = DateTime.Now;

                        break;
                    }
                    break;
                }
            }
            _ctx.SaveChanges();
            return(founded);
        }
 public IActionResult Post(Products data)
 {
     konteks.Products.Add(data);
     konteks.SaveChanges();
     return(Ok());
 }
 public IActionResult Post(RequestData <Customer_Payment_Card> data)
 {
     konteks.CPC.Add(data.Dataa.Attributes);
     konteks.SaveChanges();
     return(Ok());
 }
Beispiel #13
0
 public IActionResult Post(RequestData <Merhcant> data)
 {
     konteks.merhcants.Add(data.Dataa.Attributes);
     konteks.SaveChanges();
     return(Ok());
 }
 public IActionResult Post(Customers data)
 {
     konteks.Customers.Add(data);
     konteks.SaveChanges();
     return(Ok());
 }
 public IActionResult Post(RequestData <Products> data)
 {
     konteks.Product.Add(data.Dataa.Attributes);
     konteks.SaveChanges();
     return(Ok());
 }