Example #1
0
        public bool CrearRetail()
        {
            try
            {
                Core.DALC.QueOfrecesEntities ctx = new Core.DALC.QueOfrecesEntities();
                Core.DALC.RETAIL             ret = new Core.DALC.RETAIL();

                ret.ID_RETAIL    = this.IdRetail;
                ret.RUT          = this.RutRetail;
                ret.NOMBRE       = this.NombreRetail;
                ret.RAZON_SOCIAL = this.RazonSocial;
                ret.TELEFONO     = this.Telefono;
                ret.EMAIL        = this.Email;
                ret.DIRECCION    = this.Direccion;
                ret.REGION_ID    = this.IdRegion;
                ret.COMUNA_ID    = this.IdComuna;

                ctx.RETAIL.Add(ret);
                ctx.SaveChanges();
                ctx = null;

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Example #2
0
        public string LeerRetailId(int idRet)
        {
            Core.DALC.QueOfrecesEntities ctx = new Core.DALC.QueOfrecesEntities();
            Core.DALC.RETAIL             ret = ctx.RETAIL.First(o => o.ID_RETAIL == idRet);

            this.IdRetail     = (int)ret.ID_RETAIL;
            this.RutRetail    = ret.RUT;
            this.NombreRetail = ret.NOMBRE;
            this.RazonSocial  = ret.RAZON_SOCIAL;
            this.Telefono     = (int)ret.TELEFONO;
            this.Email        = ret.EMAIL;
            this.Direccion    = ret.DIRECCION;
            this.IdRegion     = (int)ret.REGION_ID;
            this.IdComuna     = (int)ret.COMUNA_ID;

            ctx = null;

            return(Serializar());
        }