Beispiel #1
0
        private void Guardar_Click(object sender, EventArgs e)
        {
            Database.DataClassesDataContext dc = new Database.DataClassesDataContext();
            var query = dc.WebConf.Where(w => w.Id == 1).FirstOrDefault();

            query.NombreComercial  = NombreComercial.Text;
            query.HorarioAtencion  = HorarioAtencion.Text;
            query.TelefonoContacto = TelefonoContacto.Text;
            query.Domicilio        = Domicilio.Text;
            query.Descripcion      = Descripcion.Text;
            query.PublicarCatalago = checkBoxPublicarCatalogo.Checked;
            dc.SubmitChanges();
        }
Beispiel #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         Database.DataClassesDataContext dataContext = new Database.DataClassesDataContext();
         // System.Diagnostics.Debug.WriteLine(" AHIA" +dataContext.WebConfs.Where(id => id.Id == 1));
         //We insertedEmployee = db.Employees.FirstOrDefault(e ⇒e.Name.Equals("Michael"));
         WebConf mywebconf = dataContext.WebConf.FirstOrDefault(id => id.Id == 1);
         LabelNombreComercial.Text  = (mywebconf.NombreComercial);
         LabelDescripcion.Text      = (mywebconf.Descripcion);
         LabelDomicilio.Text        = (mywebconf.Domicilio);
         LabelHorarioAtencion.Text  = (mywebconf.HorarioAtencion);
         LabelTelefonoContacto.Text = (mywebconf.TelefonoContacto);
         GridViewProductos.Visible  = (mywebconf.PublicarCatalago);
     }
     catch
     {
     }
 }
Beispiel #3
0
        public WebConf()
        {
            InitializeComponent();
            DataClassesDataContext dc = new Database.DataClassesDataContext();

            try
            {
                var query = dc.WebConf.Where(w => w.Id == 1).FirstOrDefault();
                NombreComercial.Text             = (query.NombreComercial).ToString().Trim();
                Descripcion.Text                 = (query.Descripcion).ToString().Trim();
                TelefonoContacto.Text            = (query.TelefonoContacto).ToString().Trim();
                HorarioAtencion.Text             = (query.HorarioAtencion).ToString().Trim();
                Domicilio.Text                   = (query.Domicilio).ToString().Trim();
                checkBoxPublicarCatalogo.Checked = (query.PublicarCatalago);
            }
            catch
            {
            }
        }