Example #1
0
        public void Modificar(Personas personas)
        {
            using (ClientEntities DB = new ClientEntities())
            {
                Client_Table client = DB.Client_Table.Where(x => x.Client_Id == profile_.id_profile).First();

                client.Name      = personas.Nombre;
                client.LastName  = personas.Apellido;
                client.Birthday  = personas.nacimiento;
                client.ProfileID = profile_.id_profile;



                DB.Entry(client).State = System.Data.Entity.EntityState.Modified;
                DB.SaveChanges();

                Profile_Table profile = DB.Profile_Table.Find(profile_.id_profile);
                {
                    profile.Profiel_Description = personas.Description;
                    profile.Profiel_Name        = personas.Description;
                };
                DB.Entry(profile).State = System.Data.Entity.EntityState.Modified;
                DB.SaveChanges();
            };
        }
Example #2
0
 public ActionResult Edit([Bind(Include = "Id,客戶Id,銀行名稱,銀行代碼,分行代碼,帳戶名稱,帳戶號碼")] 客戶銀行資訊 客戶銀行資訊)
 {
     if (ModelState.IsValid)
     {
         db.Entry(客戶銀行資訊).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.客戶Id = new SelectList(db.客戶資料, "Id", "客戶名稱", 客戶銀行資訊.客戶Id);
     return(View(客戶銀行資訊));
 }
Example #3
0
 public virtual void Update(T entity)
 {
     dbSet.Attach(entity);
     dataContext.Entry(entity).State = EntityState.Modified;
     dataContext.Commit();
 }