public ActionResult Consultar(int IdEmpresa = 0, int IdSucursal = 0, decimal IdProforma = 0, bool Exito = false) { #region Validar Session if (string.IsNullOrEmpty(SessionFixed.IdTransaccionSession)) { return(RedirectToAction("Login", new { Area = "", Controller = "Account" })); } SessionFixed.IdTransaccionSession = (Convert.ToDecimal(SessionFixed.IdTransaccionSession) + 1).ToString(); SessionFixed.IdTransaccionSessionActual = SessionFixed.IdTransaccionSession; #endregion fa_proforma_Info model = bus_proforma.get_info(IdEmpresa, IdSucursal, IdProforma); var info_vista = bus_proforma.get_info_vw(IdEmpresa, IdSucursal, IdProforma); model.EstadoCierre = (info_vista == null ? "" : info_vista.EstadoCierre); if (model == null) { return(RedirectToAction("Index")); } #region Permisos seg_Menu_x_Empresa_x_Usuario_Info info = bus_permisos.get_list_menu_accion(Convert.ToInt32(SessionFixed.IdEmpresa), SessionFixed.IdUsuario, "Facturacion", "Proforma", "Index"); if (model.estado == false) { info.Modificar = false; info.Anular = false; } ViewBag.Nuevo = info.Nuevo; ViewBag.Modificar = info.Modificar; ViewBag.Anular = info.Anular; #endregion model.IdEntidad = model.IdCliente; model.lst_det = bus_det.get_list(IdEmpresa, IdSucursal, IdProforma); model.IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSessionActual); List_det.set_list(model.lst_det, model.IdTransaccionSession); cargar_combos(model); if (Exito) { ViewBag.MensajeSuccess = MensajeSuccess; } #region Validacion Periodo ViewBag.MostrarBoton = true; if (!bus_periodo.ValidarFechaTransaccion(IdEmpresa, model.pf_fecha, cl_enumeradores.eModulo.FAC, model.IdSucursal, ref mensaje)) { ViewBag.mensaje = mensaje; ViewBag.MostrarBoton = false; } #endregion return(View(model)); }
private void set_info_in_controls() { try { txt_id_proforma.Text = info_proforma.IdProforma.ToString(); txt_observacion.Text = info_proforma.pf_observacion; cmb_sucursal.EditValue = info_proforma.IdSucursal; cmb_bodega.EditValue = info_proforma.IdBodega; cmb_cliente.set_ClienteInfo(info_proforma.IdCliente); cmb_termino_pago.EditValue = info_proforma.IdTerminoPago; de_fecha.EditValue = info_proforma.pf_fecha; txt_codigo.Text = info_proforma.pf_codigo; spinEditDiasPlazo.EditValue = info_proforma.pf_plazo; de_fecha_vcto.EditValue = info_proforma.pf_fecha_vcto; cmb_vendedor.EditValue = info_proforma.IdVendedor; txt_atencion_a.Text = info_proforma.pf_atencion_a; txt_dias_entrega.Text = info_proforma.pr_dias_entrega.ToString(); blst_det = new BindingList <fa_proforma_det_Info>(bus_proforma_det.get_list(info_proforma.IdEmpresa, info_proforma.IdSucursal, info_proforma.IdProforma)); gridControl_detalle.DataSource = blst_det; lbl_anulado.Visible = !info_proforma.estado; } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public ActionResult Modificar(int IdEmpresa = 0, int IdSucursal = 0, decimal IdProforma = 0) { #region Validar Session if (string.IsNullOrEmpty(SessionFixed.IdTransaccionSession)) { return(RedirectToAction("Login", new { Area = "", Controller = "Account" })); } SessionFixed.IdTransaccionSession = (Convert.ToDecimal(SessionFixed.IdTransaccionSession) + 1).ToString(); SessionFixed.IdTransaccionSessionActual = SessionFixed.IdTransaccionSession; #endregion fa_proforma_Info model = bus_proforma.get_info(IdEmpresa, IdSucursal, IdProforma); if (model == null) { return(RedirectToAction("Index")); } model.IdEntidad = model.IdCliente; model.lst_det = bus_det.get_list(IdEmpresa, IdSucursal, IdProforma); model.IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSessionActual); List_det.set_list(model.lst_det, model.IdTransaccionSession); cargar_combos(IdEmpresa); return(View(model)); }
public ActionResult Modificar(int IdEmpresa = 0, int IdSucursal = 0, decimal IdProforma = 0, bool Exito = false) { #region Validar Session if (string.IsNullOrEmpty(SessionFixed.IdTransaccionSession)) { return(RedirectToAction("Login", new { Area = "", Controller = "Account" })); } SessionFixed.IdTransaccionSession = (Convert.ToDecimal(SessionFixed.IdTransaccionSession) + 1).ToString(); SessionFixed.IdTransaccionSessionActual = SessionFixed.IdTransaccionSession; #endregion fa_proforma_Info model = bus_proforma.get_info(IdEmpresa, IdSucursal, IdProforma); if (model == null) { return(RedirectToAction("Index")); } model.IdEntidad = model.IdCliente; model.lst_det = bus_det.get_list(IdEmpresa, IdSucursal, IdProforma); model.IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSessionActual); List_det.set_list(model.lst_det, model.IdTransaccionSession); cargar_combos(IdEmpresa); if (Exito) { ViewBag.MensajeSuccess = MensajeSuccess; } #region Validacion Periodo ViewBag.MostrarBoton = true; if (!bus_periodo.ValidarFechaTransaccion(IdEmpresa, model.pf_fecha, cl_enumeradores.eModulo.FAC, model.IdSucursal, ref mensaje)) { ViewBag.mensaje = mensaje; ViewBag.MostrarBoton = false; } #endregion return(View(model)); }