public ActionResult Edit([Bind(Include = "ID,CODIGO_DEPARTAMENTO,NOMBRE")] DEPARTAMENTO dEPARTAMENTO) { if (ModelState.IsValid) { db.Entry(dEPARTAMENTO).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(dEPARTAMENTO)); }
public ActionResult Edit(int id = 0) { DEPARTAMENTO departamento = db.DEPARTAMENTOes.Find(id); if (departamento == null) { return(HttpNotFound()); } return(View(departamento)); }
public async Task <ActionResult> Edit([Bind(Include = "ID_DEPARTAMENTO,DEPARTAMENTO1")] DEPARTAMENTO dEPARTAMENTO) { if (ModelState.IsValid) { db.Entry(dEPARTAMENTO).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(dEPARTAMENTO)); }
public DeleteSolicitante(SOLICITANTE solicitante) { this.UNID_SOLICITANTE = solicitante.UNID_SOLICITANTE; this.SOLICITANTE_NAME = solicitante.SOLICITANTE_NAME; this.EMAIL = solicitante.EMAIL; this.VALIDADOR = solicitante.VALIDADOR; this._empresa = solicitante.EMPRESA; this._departamento = solicitante.DEPARTAMENTO; this.IS_ACTIVE = solicitante.IS_ACTIVE; this.IsChecked = false; }
public ActionResult Create([Bind(Include = "id_departamento,nombre_departamento")] DEPARTAMENTO dEPARTAMENTO) { if (ModelState.IsValid) { db.DEPARTAMENTOS.Add(dEPARTAMENTO); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(dEPARTAMENTO)); }
public DepartamentoESModel(SOLICITANTE Solicitante) { this._depa = Solicitante.DEPARTAMENTO; this.EMAIL = Solicitante.EMAIL; this.IS_ACTIVE = Solicitante.IS_ACTIVE; this.SOLICITANTE_NAME = Solicitante.SOLICITANTE_NAME; this.UNID_DEPARTAMENTO = Solicitante.UNID_DEPARTAMENTO; this.UNID_EMPRESA = Solicitante.UNID_EMPRESA; this.UNID_SOLICITANTE = Solicitante.UNID_SOLICITANTE; this.VALIDADOR = this.VALIDADOR; }
public ActionResult Create([Bind(Include = "ID_DEPARTAMENTO,NOMBRE,CODIGO_DEPARTAMENTO")] DEPARTAMENTO dEPARTAMENTO) { if (ModelState.IsValid) { db.DEPARTAMENTO.Add(dEPARTAMENTO); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(dEPARTAMENTO)); }
public async Task <ActionResult> Create([Bind(Include = "ID_DEPARTAMENTO,DEPARTAMENTO1")] DEPARTAMENTO dEPARTAMENTO) { if (ModelState.IsValid) { db.DEPARTAMENTO.Add(dEPARTAMENTO); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(dEPARTAMENTO)); }
protected void grReserva_SelectedIndexChanged(object sender, EventArgs e) { reservaUpdate = new Adapter.AdapterReserva(); GridViewRow gvr = grReserva.SelectedRow; long reserva = (long)grReserva.DataKeys[gvr.RowIndex].Value; foreach (Adapter.AdapterReserva item in listaReserva) { if (item._ID_RESERVA_CENTRO == reserva) { reservaUpdate = item; break; } } btnRegistroReserva.Visible = false; btnModificarReserva.Visible = true; DEPARTAMENTO departamento = Controller.ControllerDepartamento.buscarIdDepartamento(reservaUpdate._ID_DEPARTAMENTO); List<CENTRO> listaCI = Controller.ControllerCentro.listaCentroEdificio(departamento.ID_EDIFICIO); dplCentro.DataSource = listaCI; dplCentro.DataValueField = "ID_CENTRO"; dplCentro.DataTextField = "NOMBRE_CENTRO"; dplCentro.DataBind(); dplCentro.Items.Insert(0, "Seleccione un Centro"); dplCentro.SelectedIndex = 0; List<HORARIO_CENTRO> listaC = Controller.ControllerHorarioCentro.listadoHorario(reservaUpdate._ID_CENTRO); foreach (HORARIO_CENTRO item in listaC) { DateTime dia = Convert.ToDateTime(item.DIA_HORARIO); item.DIA_HORARIO = dia.ToString("dd/MM/yyy"); } dplDia.DataSource = listaC; dplDia.DataValueField = "ID_HORARIO_CENTRO"; dplDia.DataTextField = "DIA_HORARIO"; dplDia.DataBind(); dplDia.Items.Insert(0, "Seleccione un Dia"); dplDia.SelectedIndex = 0; HORARIO_CENTRO aux = Controller.ControllerHorarioCentro.buscarIdHorarioCentro(reservaUpdate._ID_HORARIO_CENTRO); List<HORARIO_CENTRO> listaHorario = Controller.ControllerHorarioCentro.listadoHorarioDia(reservaUpdate._ID_CENTRO, aux.DIA_HORARIO); dplHorario.DataSource = listaHorario; dplHorario.DataValueField = "ID_HORARIO_CENTRO"; dplHorario.DataTextField = "HORARIO_COMPLETO"; dplHorario.DataBind(); dplHorario.Items.Insert(0, "Seleccione un Horario"); dplHorario.SelectedIndex = 0; dplCentro.SelectedValue = reservaUpdate._ID_CENTRO.ToString(); dplDia.SelectedValue = reservaUpdate._ID_HORARIO_CENTRO.ToString(); dplHorario.SelectedValue = reservaUpdate._ID_HORARIO_CENTRO.ToString(); lbTotal.Text = reservaUpdate._COSTO_BOLETA.ToString(); }
protected void btnAgregarDep_Click(object sender, EventArgs e) { Adapter.AdapterDepartamento adapter = new Adapter.AdapterDepartamento(); lbError.Visible = false; Boolean option = true; if (listaDepartamento.Count <= 0) { EDIFICIO edificio = Controller.ControllerEdificio.buscarIdEdificio(Convert.ToInt64(dplEdificio.SelectedValue)); DEPARTAMENTO departamento = Controller.ControllerDepartamento.buscarIdDepartamento(Convert.ToInt64(dplDepartamento.SelectedValue)); adapter._ID_EDIFICIO = edificio.ID_EDIFICIO; adapter._NOMBRE_EDIFICIO = edificio.NOMBRE_EDIFICIO; adapter._ID_DEPARTAMENTO = departamento.ID_DEPARTAMENTO; adapter._NUMERO_DEP = departamento.NUMERO_DEP; adapter._DIMENSION_DEP = Convert.ToDouble(txtDimDepartamento.Text); listaDepartamento.Add(adapter); } else { foreach (Adapter.AdapterDepartamento item in listaDepartamento) { if (Convert.ToInt64(dplDepartamento.SelectedValue) == item._ID_DEPARTAMENTO) { option = false; } } if (option == true) { lbError.Visible = false; EDIFICIO edificio = Controller.ControllerEdificio.buscarIdEdificio(Convert.ToInt64(dplEdificio.SelectedValue)); DEPARTAMENTO departamento = Controller.ControllerDepartamento.buscarIdDepartamento(Convert.ToInt64(dplDepartamento.SelectedValue)); adapter._ID_EDIFICIO = edificio.ID_EDIFICIO; adapter._NOMBRE_EDIFICIO = edificio.NOMBRE_EDIFICIO; adapter._ID_DEPARTAMENTO = departamento.ID_DEPARTAMENTO; adapter._NUMERO_DEP = departamento.NUMERO_DEP; adapter._DIMENSION_DEP = Convert.ToDouble(txtDimDepartamento.Text); listaDepartamento.Add(adapter); } else { lbError.Visible = true; } } grDepartamento.DataSource = listaDepartamento; grDepartamento.DataBind(); lbDep.Visible = true; grDepartamento.Visible = true; dplDepartamento.SelectedIndex = 0; txtDimDepartamento.Text = ""; }
protected void btnAgregarPago_Click(object sender, EventArgs e) { lbErrorRegistro.Visible = false; btnPagarGasto.Visible = true; EDIFICIO edificio = new EDIFICIO(); GASTOS_COMUNES gasto = new GASTOS_COMUNES(); DEPARTAMENTO departamento = new DEPARTAMENTO(); PERSONA persona = new PERSONA(); List <MULTA> listaMulta = Controller.ControllerMulta.listaMultaNoPagadaDepartamento(Convert.ToInt64(dplDepartamento.SelectedValue)); long multa = 0; foreach (MULTA item in listaMulta) { multa = multa + item.COSTO_MULTA; } edificio = Controller.ControllerEdificio.buscarIdEdificio(Convert.ToInt64(dplEdificio.SelectedValue)); gasto = Controller.ControllerGastoComun.buscarGastoComunEdificio(Convert.ToInt64(dplEdificio.SelectedValue)); departamento = Controller.ControllerDepartamento.buscarIdDepartamento(Convert.ToInt64(dplDepartamento.SelectedValue)); persona = Controller.ControllerPersona.buscarPersonaRut(txtPersona.Text); if (persona == null) { lbError.Visible = true; lbPagados.Visible = false; } else { lbError.Visible = false; lbPagados.Visible = true; Adapter.AdapterBoletaGasto pago = new Adapter.AdapterBoletaGasto(); long totalBoleta = Convert.ToInt64(gasto.TOTAL_GASTO) + multa; pago._ID_GASTOS = gasto.ID_GASTOS; pago._ID_EDIFICIO = edificio.ID_EDIFICIO; pago._ID_DEPARTAMENTO = departamento.ID_DEPARTAMENTO; pago._FK_RUT = persona.FK_RUT; pago._NOMBRE_EDIFICIO = edificio.NOMBRE_EDIFICIO; pago._NUMERO_DEP = departamento.NUMERO_DEP; pago._TOTAL_GASTO = gasto.TOTAL_GASTO; pago._MULTA = multa; pago._COSTO_BOLETA = totalBoleta; listaGastos.Add(pago); grGastos.DataSource = listaGastos; grGastos.DataBind(); total = total + pago._COSTO_BOLETA; lbTotal.Text = total.ToString(); dplDepartamento.SelectedIndex = 0; listGastos.DataSource = null; listGastos.DataBind(); } }
// GET: DEPARTAMENTOes/Edit/5 public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DEPARTAMENTO dEPARTAMENTO = await db.DEPARTAMENTO.FindAsync(id); if (dEPARTAMENTO == null) { return(HttpNotFound()); } return(View(dEPARTAMENTO)); }
// GET: Departamento/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DEPARTAMENTO dEPARTAMENTO = db.DEPARTAMENTO.Find(id); if (dEPARTAMENTO == null) { return(HttpNotFound()); } return(View(dEPARTAMENTO)); }
// GET: DEPARTAMENTOS/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(RedirectToAction("Index")); } DEPARTAMENTO dEPARTAMENTO = db.DEPARTAMENTOS.Find(id); if (dEPARTAMENTO == null) { return(HttpNotFound()); } return(View(dEPARTAMENTO)); }
protected void dplDepartamento_SelectedIndexChanged(object sender, EventArgs e) { try { lbMultasExistentes.Visible = true; lbError.Visible = false; txtMotivo.Text = ""; txtMulta.Text = ""; DEPARTAMENTO dep = Controller.ControllerDepartamento.buscarIdDepartamento(Convert.ToInt64(dplDepartamento.SelectedValue)); List <MULTA> listaMultas = new List <MULTA>(); listaMultas = Controller.ControllerMulta.listaMultaNoPagadaDepartamento(dep.ID_DEPARTAMENTO); string multa = ""; listaMulta = new List <string>(); foreach (MULTA item in listaMultas) { multa = item.MOTIVO + " " + item.COSTO_MULTA; listaMulta.Add(multa); } listadoMultas.DataSource = listaMulta; listadoMultas.DataBind(); listadoMultas.Visible = true; } catch (Exception ex) { long departamento = dplDepartamento.SelectedIndex; txtMotivo.Text = ""; txtMulta.Text = ""; if (departamento == 0) { lbError.Visible = false; lbMultasExistentes.Visible = false; listaDepartamento = new List <Adapter.AdapterDepartamento>(); grMulta.DataSource = listaDepartamento; grMulta.DataBind(); listaMulta = new List <string>(); listadoMultas.DataSource = listaMulta; listadoMultas.DataBind(); listadoMultas.Visible = false; } else { lbError.Visible = true; lbMultasExistentes.Visible = false; lbError.Text = "El departamento no presenta Multas a la Fecha"; listadoMultas.Visible = false; } System.Diagnostics.Debug.WriteLine("Error: " + ex); } }
protected void Page_Load() { if (!(User.IsInRole(AspNetRoles.ADMINISTRADOR)) && !(User.IsInRole(AspNetRoles.VALIDADOR))) { //Intenta acceder un usuario sin permisos logger.Fatal("No autorizadoError en AdmPlan.aspx. Comprobar si el directorio está bien configurado. Usuario: " + User.Identity.GetUserId()); Response.Redirect("../Default.aspx", true); } if (Request["id"] == null) { Response.Redirect("../Default.aspx", false); } using (Entities c = new Entities()) { try { DEPARTAMENTO dep = c.DEPARTAMENTO.Find(Convert.ToInt32(Request["id"])); NombreDepartamento = dep.DESCRIPCION; } catch { } } if (!IsPostBack) { if (!String.IsNullOrEmpty(Request["e"])) { ErrorMessage = Request["e"]; errorMessage.Visible = true; } else if (!String.IsNullOrEmpty(Request["m"])) { SuccessMessage = Request["m"]; successMessage.Visible = true; } else { ErrorMessage = ""; errorMessage.Visible = false; SuccessMessage = ""; successMessage.Visible = false; } } }
protected void btnAgregarDepartamento_Click(object sender, EventArgs e) { Adapter.AdapterDepartamento adapter = new Adapter.AdapterDepartamento(); lbError.Visible = false; Boolean operation = true; if (listaDepartamento.Count > 0) { foreach (Adapter.AdapterDepartamento item in listaDepartamento) { if (item._ID_DEPARTAMENTO == Convert.ToInt64(dplDepartamento.SelectedValue)) { lbError.Visible = true; lbError.Text = "Departamento ya Asignado"; operation = false; } } } if (operation == true) { lbError.Visible = false; CONDOMINIO condominio = Controller.ControllerCondominio.buscarIdCondominio(Convert.ToInt64(dplCondominio.SelectedValue)); EDIFICIO edificio = Controller.ControllerEdificio.buscarIdEdificio(Convert.ToInt64(dplEdificio.SelectedValue)); DEPARTAMENTO departamento = Controller.ControllerDepartamento.buscarIdDepartamento(Convert.ToInt64(dplDepartamento.SelectedValue)); adapter._ID_CONDOMINIO = condominio.ID_CONDOMINIO; adapter._NOMBRE_CONDOMINIO = condominio.NOMBRE_CONDOMINIO; adapter._ID_EDIFICIO = edificio.ID_EDIFICIO; adapter._NOMBRE_EDIFICIO = edificio.NOMBRE_EDIFICIO; adapter._ID_DEPARTAMENTO = departamento.ID_DEPARTAMENTO; adapter._NUMERO_DEP = departamento.NUMERO_DEP; listaDepartamento.Add(adapter); listaDep.Add(departamento); grDepartamento.DataSource = listaDepartamento; grDepartamento.DataBind(); dplCondominio.SelectedIndex = 0; dplEdificio.SelectedIndex = 0; dplDepartamento.SelectedIndex = 0; } dplDepElemento.DataSource = listaDep; dplDepElemento.DataValueField = "ID_DEPARTAMENTO"; dplDepElemento.DataTextField = "NUMERO_DEP"; dplDepElemento.DataBind(); dplDepElemento.Items.Insert(0, "Seleccione un Departamento"); dplDepElemento.SelectedIndex = 0; }
public static DEPARTAMENTO buscarIdDepartamento(long departamento) { using (EasyLifeEntities dbc = new EasyLifeEntities()) { DEPARTAMENTO aux = (from u in dbc.DEPARTAMENTO where u.ID_DEPARTAMENTO == departamento select u).SingleOrDefault(); if (aux != null) { return(aux); } else { return(null); } } }
public static DEPARTAMENTO buscarDepartamento(string departamento, long edificio) { using (EasyLifeEntities dbc = new EasyLifeEntities()) { DEPARTAMENTO aux = (from u in dbc.DEPARTAMENTO where u.NUMERO_DEP == departamento && u.ID_EDIFICIO == edificio select u).SingleOrDefault(); if (aux != null) { return(aux); } else { return(null); } } }
public void DeleteDEPARTAMENTO(int id) { int retorno = 0; /*DEPARTAMENTO oDepartamento = null;*/ try { using (MyContext ctx = new MyContext()) { /*ctx.Configuration.LazyLoadingEnabled = false; * oDepartamento = GetDepartamentoByID(id); * * if (oDepartamento == null) * { * //Insertar * oDepartamento.Estado = false; * * //ctx.DEPARTAMENTO.Add(oDepartamento); * ctx.Entry(oDepartamento).State = EntityState.Modified; * retorno = ctx.SaveChanges(); * } */ ctx.Configuration.LazyLoadingEnabled = false; DEPARTAMENTO depart = new DEPARTAMENTO() { Estado = false }; ctx.Entry(depart).State = EntityState.Modified; retorno = ctx.SaveChanges(); } } catch (DbUpdateException dbEx) { string mensaje = ""; Log.Error(dbEx, System.Reflection.MethodBase.GetCurrentMethod(), ref mensaje); throw new Exception(mensaje); } catch (Exception ex) { string mensaje = ""; Log.Error(ex, System.Reflection.MethodBase.GetCurrentMethod(), ref mensaje); throw; } }
public void insertElementSync(object element) { if (element != null) { using (var entity = new TAE2Entities()) { DEPARTAMENTO departamento = (DEPARTAMENTO)element; //Sync var modifiedSync = entity.SYNCs.First(p => p.UNID_SYNC == 20120101000000000); modifiedSync.ACTUAL_DATE = UNID.getNewUNID(); entity.SaveChanges(); // entity.DEPARTAMENTOes.AddObject(departamento); entity.SaveChanges(); } } }
public ActionResult Create(DEPARTAMENTO departamento) { if (ModelState.IsValid) { Int32?intCD_DEPARTAMENTO = db.DEPARTAMENTOes.Max(s => (Int32?)s.CD_DEPARTAMENTO); if (intCD_DEPARTAMENTO != null) { intCD_DEPARTAMENTO++; } else { intCD_DEPARTAMENTO = 1; } departamento.CD_DEPARTAMENTO = (Int32)intCD_DEPARTAMENTO; db.DEPARTAMENTOes.Add(departamento); try { string sql = string.Format(" INSERT INTO DEPARTAMENTO VALUES ({0},\'{1}\',{2},\'{3}\',\'{4}\', \'{5}\')", departamento.CD_DEPARTAMENTO, departamento.DESC_DEPARTAMENTO, departamento.TEMPO_PADRAO, departamento.ENVIA_EMAIL, departamento.ATIVO, departamento.NIVEL_SERVICO); db.Database.ExecuteSqlCommand(sql); //db.SaveChanges(); } catch (Exception error) { throw new Exception(error.ToString()); } return(RedirectToAction("Index")); } return(View(departamento)); }
public ActionResult ConfirmarCreate(DEPARTAMENTO departamento) { if (Session.IsFuncionario()) { #region Validações if (string.IsNullOrEmpty(departamento.DESCRICAO)) { return(Json(new { status = 100, ex = "Informe uma descrição!" })); } if (string.IsNullOrEmpty(departamento.SITUACAO)) { return(Json(new { status = 100, ex = "Informe um situação!" })); } #endregion #region Incluir Departamento if (!string.IsNullOrEmpty(departamento.DESCRICAO)) { departamento.DESCRICAO = departamento.DESCRICAO.ToUpper(); } _db.DEPARTAMENTO.Add(departamento); #endregion #region Incluir Rateio #endregion _db.SaveChanges(); return(Json(new { status = 200, msg = "Incluído com sucesso!" })); } else { return(RedirectToAction("", "")); } }
public void cargarParametros(string estacionamiento) { ESTACIONAMIENTO_VISITA aux = Controller.ControllerEstacionamientoVisita.buscarIdEstacionamiento(Convert.ToInt64(estacionamiento)); DEPARTAMENTO dep = Controller.ControllerDepartamento.buscarDepartamento(aux.NUM_DEP, aux.EDIFICIO); List <DEPARTAMENTO> listaEdificio = Controller.ControllerDepartamento.listaDepartamentoOcupado(aux.EDIFICIO); dplDepartamento.DataSource = listaEdificio; dplDepartamento.DataValueField = "ID_DEPARTAMENTO"; dplDepartamento.DataTextField = "NUMERO_DEP"; dplDepartamento.DataBind(); dplEdificio.SelectedValue = aux.EDIFICIO.ToString(); dplDepartamento.SelectedValue = dep.ID_DEPARTAMENTO.ToString(); txtPatente.Text = aux.PATENTE; string horaE = aux.HORA_ENTRADA.Substring(11, 5); txtHoraEntrada.Text = horaE; btnRegistroEst.Visible = false; btnRegistroSalida.Visible = true; }
public void deleteElement(object element) { if (element != null) { using (var entity = new TAE2Entities()) { DEPARTAMENTO departamento = (DEPARTAMENTO)element; var deleteDepartamento = entity.DEPARTAMENTOes.First(p => p.UNID_DEPARTAMENTO == departamento.UNID_DEPARTAMENTO); deleteDepartamento.IS_ACTIVE = false; //Sync deleteDepartamento.IS_MODIFIED = true; deleteDepartamento.LAST_MODIFIED_DATE = UNID.getNewUNID(); var modifiedSync = entity.SYNCs.First(p => p.UNID_SYNC == 20120101000000000); modifiedSync.ACTUAL_DATE = UNID.getNewUNID(); entity.SaveChanges(); // entity.SaveChanges(); } } }
public void udpateElement(object element, USUARIO u) { if (element != null) { using (var entity = new TAE2Entities()) { DEPARTAMENTO departamento = (DEPARTAMENTO)element; var modifiedDepartamento = entity.DEPARTAMENTOes.First(p => p.UNID_DEPARTAMENTO == departamento.UNID_DEPARTAMENTO); modifiedDepartamento.DEPARTAMENTO_NAME = departamento.DEPARTAMENTO_NAME; //Sync modifiedDepartamento.IS_MODIFIED = true; modifiedDepartamento.LAST_MODIFIED_DATE = UNID.getNewUNID(); var modifiedSync = entity.SYNCs.First(p => p.UNID_SYNC == 20120101000000000); modifiedSync.ACTUAL_DATE = UNID.getNewUNID(); entity.SaveChanges(); // UNID.Master(departamento, u, -1, "Modificación"); } } }
protected void btnRegistroEst_Click(object sender, EventArgs e) { System.Threading.Thread.Sleep(5000); DEPARTAMENTO departamento = Controller.ControllerDepartamento.buscarIdDepartamento(Convert.ToInt64(dplDepartamento.SelectedValue)); string date = DateTime.Now.Date.ToString(); string patente = txtPatente.Text; string horaE = date.Substring(0, 10) + " " + txtHoraEntrada.Text; total = 0; string result = Controller.ControllerEstacionamientoVisita.crearEstacionamiento(departamento.NUMERO_DEP, Convert.ToInt64(dplEdificio.SelectedValue), patente, horaE, total); if (result.Equals("Estacionamiento Creado")) { ScriptManager.RegisterStartupScript(this, this.GetType(), "alertIns", "alert('Estacionamiento Registrado');window.location.href='" + Request.RawUrl + "';", true); } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "alertIns", "alert('Error al Registrar Estacionamiento');window.location.href='" + Request.RawUrl + "';", true); } }
public MovimientoModel(IDataMapper dataMapper, int mov) { if ((dataMapper as MovimientoDataMapper) != null) { this._dataMapper = dataMapper as MovimientoDataMapper; } this._tipoMovimiento = new TIPO_MOVIMIENTO(); this._almacenDestino = new ALMACEN(); this._proveedorProcedencia = new PROVEEDOR(); this._clienteProcedencia = new CLIENTE(); this._almacenProcedencia = new ALMACEN(); this._servicio = new SERVICIO(); this._transporte = new TRANSPORTE(); this._cliente = new CLIENTE(); this._proveedor = new PROVEEDOR(); this._facturaVenta = new FACTURA_VENTA(); this._solicitante = null; this._tecnico = new TECNICO(); this._solicitanteLectura = new SOLICITANTE(); this._empresaLectura = new EMPRESA(); this._departamentoLectura = new DEPARTAMENTO(); }
public ActionResult ConfirmarEdit(DEPARTAMENTO departamento) { if (Session.IsFuncionario()) { #region Validações if (string.IsNullOrEmpty(departamento.DESCRICAO)) { return(Json(new { status = 100, ex = "Informe uma descrição!" })); } if (string.IsNullOrEmpty(departamento.SITUACAO)) { return(Json(new { status = 100, ex = "Informe um situação!" })); } #endregion #region Alterar Departamento if (!string.IsNullOrEmpty(departamento.DESCRICAO)) { departamento.DESCRICAO = departamento.DESCRICAO.ToUpper(); } _db.Entry(departamento).State = EntityState.Modified; #endregion _db.SaveChanges(); return(Json(new { status = 200, msg = "Alterado com sucesso!" })); } else { return(RedirectToAction("", "")); } }
public void CreaDepartamento() { if (u == null) { Inicial(); } if (l == null) { CreaLegislatura(); } using (Entities c = new Entities()) { d = new DEPARTAMENTO() { DESCRIPCION = "Departamento Desde Test", LEGISLATURA_ID = l.LEGISLATURA_ID, VISIBLE = true }; c.DEPARTAMENTO.Add(d); } }