Example #1
0
        public void Create(Custumer_Model model)
        {
            var data = Connect_Enttity.Custumers.FirstOrDefault(x => x.iusid == model.iusid);

            if (data == null)
            {
                var entity = new Custumer();
                entity.iusid       = model.iusid;
                entity.vusername   = model.vusername;
                entity.vpassword   = model.vpassword;
                entity.vcusname    = model.vcusname;
                entity.dbirthday   = model.dbirthday;
                entity.vprovince   = model.vprovince;
                entity.vaddress    = model.vaddress;
                entity.vphone      = model.vphone;
                entity.vmobile     = model.vmobile;
                entity.vemail      = model.vemail;
                entity.dcreatedate = Convert.ToDateTime(model.dcreatedate);
                entity.istatus     = (short)(model.istatus);

                Connect_Enttity.Custumers.Add(entity);
                Connect_Enttity.SaveChanges();
                Dispose();
            }
        }
Example #2
0
        public IList <Custumer_Model> GetId(Custumer_Model model)
        {
            IList <Custumer_Model> result = new List <Custumer_Model>();

            result = Connect_Enttity.Custumers.Where(x => x.iusid == model.iusid).Select(x => new Custumer_Model
            {
                iusid       = x.iusid,
                vusername   = x.vusername,
                vpassword   = x.vpassword,
                vcusname    = x.vcusname,
                dbirthday   = x.dbirthday,
                vprovince   = x.vprovince,
                vaddress    = x.vaddress,
                vphone      = x.vphone,
                vmobile     = x.vmobile,
                vemail      = x.vemail,
                dcreatedate = Convert.ToDateTime(x.dcreatedate),
                istatus     = (short)(x.istatus)
            }).ToList();

            return(result);
        }
Example #3
0
 public IEnumerable <Custumer_Model> ReadID(Custumer_Model model)
 {
     return(GetId(model));
 }