Ejemplo n.º 1
0
        public bool updateSmartPhone(Smartphone smartPhone)
        {
            Smartphone smartphoneUpdate = db.Smartphones.SingleOrDefault(x => x.Code == smartPhone.Code);

            if (smartphoneUpdate != null)
            {
                smartphoneUpdate.Name  = smartPhone.Name;
                smartphoneUpdate.Price = smartPhone.Price;
                smartphoneUpdate.Color = smartPhone.Color;
                smartphoneUpdate.Brand = smartPhone.Brand;

                db.SubmitChanges();
                return(true);
            }
            else
            {
                return(false);
            }
        }
 partial void DeleteSmartphone(Smartphone instance);
 partial void UpdateSmartphone(Smartphone instance);
 partial void InsertSmartphone(Smartphone instance);
Ejemplo n.º 5
0
        public Smartphone selectSmartPhoneByCode(int code)
        {
            Smartphone smartphone = db.Smartphones.SingleOrDefault(x => x.Code == code);

            return(smartphone);
        }