Beispiel #1
0
        public p_phone_detail AddPhoneDetail(p_phone_detail detail)
        {
            p_phone_detail phone = context.p_phone_detail.Add(detail);

            context.SaveChanges();
            return(phone);
        }
Beispiel #2
0
        public p_phone ReMovePhone(String id)
        {
            p_phone phone = context.p_phone.Find(id);

            if (phone != null)
            {
                context.p_phone.Remove(phone);
                p_phone_detail detail = context.p_phone_detail.Find(phone.phone_detail_id);
                context.p_phone_detail.Remove(detail);
                context.SaveChanges();
                return(phone);
            }
            return(phone);
        }
Beispiel #3
0
        public p_phone_detail EditPhoneDetail(p_phone_detail detail)
        {
            p_phone_detail phone = FindPhoneDetailById(detail.phone_detail_id);

            if (phone != null)
            {
                phone.phone_detail_id = detail.phone_detail_id;
                phone.memory          = detail.memory;
                phone.pin             = detail.pin;
                phone.ram             = detail.ram;
                phone.screen_size     = detail.screen_size;
                context.SaveChanges();
            }
            return(phone);
        }
Beispiel #4
0
        public p_phone_detail FindOneById(String id)
        {
            p_phone_detail detail = model.FindPhoneDetailById(id);

            return(detail);
        }
Beispiel #5
0
        public p_phone_detail EditPhoneDetail(p_phone_detail detail)
        {
            p_phone_detail phone = model.EditPhoneDetail(detail);

            return(phone);
        }
Beispiel #6
0
        public p_phone_detail AddNewPhone(p_phone_detail detail)
        {
            p_phone_detail phone = model.AddPhoneDetail(detail);

            return(phone);
        }
Beispiel #7
0
        public p_phone_detail FindPhoneDetailById(String id)
        {
            p_phone_detail detail = context.p_phone_detail.FirstOrDefault(e => e.phone_detail_id == id);

            return(detail);
        }