Example #1
0
        protected void btnCambiaContrasena_Click(object sender, EventArgs e)
        {
            svcSCPP.SCPPClient svc         = new svcSCPP.SCPPClient();
            string             User        = NomUsuario.Text;
            string             ContraAnt   = ContrasenaAnt.Text;
            string             ContraNueva = ContrasenaNueva.Text;



            LAMOSA.SCPP.Server.BusinessEntity.ContrasenaL C = new LAMOSA.SCPP.Server.BusinessEntity.ContrasenaL();

            try
            {
                C.Usuario         = User;
                C.Contrasena      = ContraAnt;
                C.ContrasenaNueva = ContraNueva;
                C = svc.CambiarContrasenaLogin(C);
                string msj = C.ExceptionMessage;
                if (C.ExceptionMessage != null && C.ExceptionMessage.Length > 30)
                {
                    CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel1, "<script type='text/javascript'>alert('" + C.ExceptionMessage + "');</script>");
                }
                else
                {
                    CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel1, "<script type='text/javascript'>alert('" + C.ExceptionMessage + "');</script>");
                }
            }
            catch (Exception err)
            {
                CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel1, "<script type='text/javascript'>alert('" + err.Message + "');</script>");
            }
        }
        protected void btnAutorizaWD_click(object sendder, EventArgs e)
        {
            try
            {
                String  msg  = "";
                Usuario user = (Usuario)Session["UserLogged"];
                if (user != null)
                {
                    svcSCPP.SCPPClient svc = new svcSCPP.SCPPClient();
                    LAMOSA.SCPP.Server.BusinessEntity.ConfigBancos cbr = new LAMOSA.SCPP.Server.BusinessEntity.ConfigBancos();
                    cbr.CodConfigBanco     = int.Parse(hddConfiguracionBanco.Value);
                    cbr.CodUsuarioAutoriza = user.CodUsuario;
                    svc.AutorizaConfigBanco(cbr);
                    msg = "Banco autorizado";
                    BlockControls(false, false);
                }
                else
                {
                    msg = "No hay usuario en session, favor de autentificarse primero";
                }
                CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel2, "<script type='text/javascript'>alert('" + msg + "');</script>");
            }
            catch (Exception err)
            {
                CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel2, "<script type='text/javascript'>alert('" + err.Message + "');</script>");
            }

            LlenaGridWD();
        }
        protected void uwgCodigBarras_DeleteRow(object sender, RowEventArgs e)
        {
            String id   = e.Row.Cells[0].ToString();
            String resp = new CodigoBarras().DeleteCodigoBarras(id);

            CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel1, "<script type='text/javascript'>alert('" + resp + "');</script>");
        }
Example #4
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            svcConfigAlerta.IConfigAlertaServiceManager svc = new svcConfigAlerta.ConfigAlertaServiceManagerClient();
            svcConfigAlerta.ConfigAlerta obj = new LAMOSA.SCPP.Client.View.Administrador.svcConfigAlerta.ConfigAlerta();

            obj = llenaObjeto();


            try
            {
                if (obj.Codigo <= 0)
                {
                    if ((bool)ViewState["nuevo"])
                    {
                        int respuesta = svc.Agregar(obj);
                        if (respuesta > 0)
                        {
                            hdnId.Value = respuesta.ToString();
                        }

                        if (respuesta > 0)
                        {
                            CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel1, "<script type='text/javascript'>alert('Se guardo correctamente');</script>");
                        }
                        else
                        {
                            CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel1, "<script type='text/javascript'>alert('Ocurrio un error al momento de guardar');</script>");
                        }
                    }
                    else
                    {
                        CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel1, "<script type='text/javascript'>alert('No tiene permiso de agregar un registro nuevo');</script>");
                    }
                }
                else
                {
                    if ((bool)ViewState["editar"])
                    {
                        bool actualizado = svc.Actualizar(obj);
                        if (actualizado)
                        {
                            CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel1, "<script type='text/javascript'>alert('Se actualizo el registro correctamente');</script>");
                        }
                        else
                        {
                            CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel1, "<script type='text/javascript'>alert('Ocurrio un error al momento de actualizar');</script>");
                        }
                    }
                    else
                    {
                        CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel1, "<script type='text/javascript'>alert('No tiene permiso de actualizar');</script>");
                    }
                }
            }
            catch (Exception ex)
            {
                CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel1, "<script type='text/javascript'>alert('" + ex.Message + "');</script>");
            }
        }
        protected void btnAgregarWD_click(object sender, EventArgs e)
        {
            try
            {
                try
                {
                    Boolean combos = false;
                    //if (int.Parse(hddConfiguracionBanco.Value) > 0)
                    //{
                    //    combos = false;
                    //}
                    AutWD.Checked = bool.Parse(hddAut.Value);
                    BlockControls(!AutWD.Checked, combos);
                }
                catch { }

                Usuario user = (Usuario)Session["UserLogged"];

                svcSCPP.SCPPClient svc = new svcSCPP.SCPPClient();
                LAMOSA.SCPP.Server.BusinessEntity.ConfigBancoResgistro cbr = new LAMOSA.SCPP.Server.BusinessEntity.ConfigBancoResgistro();
                cbr.Activo            = true;
                cbr.CantMoldes        = int.Parse(CantidadMoldesWD.Text);
                cbr.CodConfigBanco    = !hddConfiguracionBanco.Value.Equals("") ? int.Parse(hddConfiguracionBanco.Value) : -1;
                cbr.CodMaquina        = int.Parse(MaquinaWD.SelectedValue);
                cbr.CodMolde          = int.Parse(MoldeWD.SelectedValue);
                cbr.CodUsuarioAlta    = user.CodUsuario;
                cbr.Limitevaciadas    = int.Parse(LimVaciadasWD.Text);
                cbr.Vaciadasdia       = int.Parse(VaciadasDiaWD.Text);
                cbr.NumeroImpresiones = int.Parse(txtNumImpresiones.Text);

                String msg = !hddConfiguracionBanco.Value.Equals("") ? "Modificacion" : "Creacion";
                int    res = svc.GuardarConfigBanco(cbr);
                if (res > 0)
                {
                    hddConfiguracionBanco.Value = res.ToString();
                    BlockControls(true, false);
                }
                else
                {
                    throw new Exception("No se pudo realizar la operacion");
                }
                UltraWebGrid1.DataSource = svc.ObtenerConfiguracionBancoDetalle(res);
                UltraWebGrid1.DataBind();



                ConfigTablaWD();
                CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel2, "<script type='text/javascript'>alert('La " + msg + " se ha completado con exito');</script>");
            }
            catch (Exception err)
            {
                CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel2, "<script type='text/javascript'>alert('" + err.Message.Replace("'", "\"") + "');</script>");
            }

            CantidadMoldesWD.Text  = "";
            VaciadasDiaWD.Text     = "";
            txtNumImpresiones.Text = "";
        }
Example #6
0
    public CallManager()
    {
        int count = (int)EventType.NoUsingOnlyNum;

        m_EventManagers = new EventManager[count];
        for (int i = 0; i < count; i++)
        {
            m_EventManagers[i] = new EventManager();
        }
        m_CallbackManager = new CallBackManager();
    }
 private void DesbloquearUsuario(int CodigoUsuario)
 {
     try
     {
         svcSCPP.SCPPClient svc = new svcSCPP.SCPPClient();
         svc.DesbloquearUsuario(CodigoUsuario);
     }
     catch (Exception ex)
     {
         CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel1, "<script type='text/javascript'>alert('" + ex.Message + "');</script>");
     }
 }
Example #8
0
 protected void btnEliminar_Click(object sender, EventArgs e)
 {
     foreach (UltraGridRow row in this.uwgCodigBarras.Rows)
     {
         if (row.Selected)
         {
             String id   = row.Cells[0].ToString();
             String resp = new CodigoBarras().DeleteCodigoBarras(id);
             CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel1, "<script type='text/javascript'>alert('" + resp + "');</script>");
             llenaGrid();
             break;
         }
     }
 }
        protected void btnSave_Click1(object sender, EventArgs e)
        {
            String msg = "";

            try
            {
                int cod_reemplazo = Convert.ToInt32(HCodReemplazo.Value);
                int cod_detenido  = Convert.ToInt32(HCodDetenido.Value);
                msg = new CodigoReemplazo().GenerateReplacementCodes(cod_reemplazo, cod_detenido);
            }
            catch { msg = "Hubo un problema al generar la accion, intente nuevamente"; }
            CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel1, "<script type='text/javascript'>alert('" + msg + "');</script>");
            Button1_Click(null, null);
        }
Example #10
0
 protected void btnExportaDetalle_Click(object sender, EventArgs e)
 {
     try
     {
         int       id = Convert.ToInt32(hIdInventario.Value);
         DataTable dt = new server.Inventarios().InventarioEnProcesoDetalle(id);
         DataSet   ds = new DataSet();
         ds.Tables.Add(dt);
         ExportToExcel(ds, 0, Response, "Inventario en Proceso");
     }
     catch (Exception er)
     {
         CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel2, "<script type='text/javascript'>alert('Hubo un problema al Generar el Excel, intente nuevamente');</script>");
     }
 }
Example #11
0
        protected void UltraWebGrid1_DeleteRow(object sender, RowEventArgs e)
        {
            String msg = "";

            try
            {
                msg = new server.Inventarios().InventarioEnProcesoEliminar(Convert.ToInt32(e.Row.Cells[0].Value.ToString()));
            }
            catch
            {
                msg = "Hubo un problema al procesar la informacion, intente nuevamente.";
            }
            CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel1, "<script type='text/javascript'>alert('" + msg + "');</script>");
            FillGrid();
        }
 private void ResetearContrasenaUsuario(int CodigoUsuario, string CuentaUsuario)
 {
     try
     {
         svcSCPP.SCPPClient svc        = new svcSCPP.SCPPClient();
         ContrasenaC        contrasena = new ContrasenaC();
         contrasena.codUsuario      = Convert.ToInt32(CodigoUsuario);
         contrasena.ContrasenaNueva = contrasena.Contrasena = "Lamosa06";
         contrasena = svc.CambiarContrasena(contrasena);
         CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel1, "<script type='text/javascript'>alert('" + contrasena.ExceptionMessage + "');</script>");
     }
     catch (Exception ex)
     {
         CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel1, "<script type='text/javascript'>alert('" + ex.Message + "');</script>");
     }
 }
Example #13
0
        protected void BotonGuardar_click(object sender, EventArgs e)
        {
            svcSCPP.SCPPClient svc = new svcSCPP.SCPPClient();
            LAMOSA.SCPP.Server.BusinessEntity.MetasProd m = new LAMOSA.SCPP.Server.BusinessEntity.MetasProd();

            try
            {
                m.Planta      = int.Parse(hddPlanta.Value);
                m.CantProc    = int.Parse(hddcant_procesadas.Value);
                m.CantInv     = int.Parse(hddcant_inventario.Value);
                m.CantDesp    = int.Parse(hddcant_desperdicio.Value);
                m.CantVerde   = int.Parse(hddcant_desp_verde.Value);
                m.CantQuemado = int.Parse(hddcant_desp_quemado.Value);
                m.ICalidad1   = int.Parse(hddcalidad1.Value);
                m.PorcCal1    = int.Parse(hddporcentaje_cal1.Value);
                m.ICalidad2   = int.Parse(hddcalidad2.Value);
                m.PorcCal2    = int.Parse(hddporcentaje_cal2.Value);
                m.ICalidad3   = int.Parse(hddcalidad3.Value);
                m.PorcCal3    = int.Parse(hddporcentaje_cal3.Value);
                m.ICalidad4   = int.Parse(hddcalidad4.Value);
                m.PorcCal4    = int.Parse(hddporcentaje_cal4.Value);
                m.TipoProc    = int.Parse(hddtipo_procesadas.Value);
                m.TipoInv     = int.Parse(hddtipo_inventario.Value);
                m.TipoDesp    = int.Parse(hddtipo_desperdicio.Value);
                m.TipoVerde   = int.Parse(hddtipo_desp_verde.Value);
                m.TipoQuemado = int.Parse(hddtipo_desp_quemado.Value);
                m.TipoCal1    = int.Parse(hddtipo_porcent_cal1.Value);
                m.TipoCal2    = int.Parse(hddtipo_porcent_cal2.Value);
                m.TipoCal3    = int.Parse(hddtipo_porcent_cal3.Value);
                m.TipoCal4    = int.Parse(hddtipo_porcent_cal4.Value);



                svc.GuardarMetasProd(m);
                btnLlenaGrid_Click(sender, e);
                WebAsyncRefreshPanel1.DataBind();
                if (m.ExceptionMessage != null && m.ExceptionMessage.Length > 1)
                {
                    throw new Exception(m.ExceptionMessage);
                }
            }
            catch (Exception err)
            {
                CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel1, "<script type='text/javascript'>alert('" + err.Message + "');</script>");
            }
        }
        protected void BotonGuardar_click(object sender, EventArgs e)
        {
            svcSCPP.SCPPClient svc = new svcSCPP.SCPPClient();
            LAMOSA.SCPP.Server.BusinessEntity.Usuario u = new LAMOSA.SCPP.Server.BusinessEntity.Usuario();
            try
            {
                u.NombreUsuario = hddNombreUsuario.Value;
                //u.Contrasena= hddContrasena.Value;
                u.Contrasena = "Lamosa06";
                int CodEmpleado = -1;
                int.TryParse(hddCodEmpleado.Value, out CodEmpleado);
                u.CodEmpleado = CodEmpleado;

                int CodRol = -1;
                int.TryParse(hddCodRol.Value, out CodRol);
                u.CodRol = CodRol;

                int Supervisor = -1;
                int.TryParse(hddSupervisor.Value, out Supervisor);
                u.CodSupervisor = Supervisor;

                if (hddBloqueado.Value.ToLower() == @"'true'")
                {
                    u.Bloqueado = true;
                }

                u.Email = hddCorreo.Value;

                int CodUsuario = -1;
                int.TryParse(hddCodUsuario.Value, out CodUsuario);
                u.CodUsuario = CodUsuario;

                u = svc.GuardarUsuario(u);

                WebAsyncRefreshPanel1.DataBind();
                if (u.ExceptionMessage != null && u.ExceptionMessage.Length > 1)
                {
                    throw new Exception(u.ExceptionMessage);
                }
            }
            catch (Exception err)
            {
                CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel1, "<script type='text/javascript'>alert('" + err.Message + "');</script>");
            }
            llenaGrid();
        }
Example #15
0
        protected void btnGenerarInventario_Click(object sender, EventArgs e)
        {
            String msg = "";

            try
            {
                Usuario user = (Usuario)Session["UserLogged"];
                if (user != null)
                {
                    DropDownList cmbPlanta = ((DropDownList)Page.Master.FindControl("cmbPlanta"));
                    int          iPlanta   = Convert.ToInt32(cmbPlanta.SelectedValue);
                    msg = new server.Inventarios().InventarioEnProcesoGenerar(user.CodUsuario, iPlanta);
                }
            }
            catch { msg = "Hubo un problema al generar el Inventario, intente nuevamente."; }
            CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel1, "<script type='text/javascript'>alert('" + msg + "');</script>");
            FillGrid();
        }
Example #16
0
        protected void btnBuscaDetalle_Click(object sender, EventArgs e)
        {
            String msg = "";

            try
            {
                int id = Convert.ToInt32(hIdInventario.Value);
                UltraWebGrid2.DataSource = new server.Inventarios().InventarioEnProcesoDetalle(id);
                UltraWebGrid2.DataBind();
                if (UltraWebGrid2.Rows.Count > 0)
                {
                    UltraWebGrid2.Columns[0].Hidden = true;
                }
            }
            catch
            {
                msg = "Hubo un problema al generar el Inventario, intente nuevamente.";
                CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel2, "<script type='text/javascript'>alert('" + msg + "');</script>");
            }
        }
        private void LlenaGridWD()
        {
            svcSCPP.SCPPClient svc = new svcSCPP.SCPPClient();
            LimVaciadasWD.Text = hddVacAcu.Value;
            AutWD.Checked      = bool.Parse(hddAut.Value);
            int res = int.Parse(hddConfiguracionBanco.Value);

            UltraWebGrid1.DataSource = svc.ObtenerConfiguracionBancoDetalle(res);
            UltraWebGrid1.DataBind();

            if (UltraWebGrid1.Rows.Count > 0)
            {
                bandera(null, null);
                ConfigTablaWD();
            }
            else
            {
                CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel2, "<script type='text/javascript'>alert('El banco no tiene modelos configurados');</script>");
            }
        }
        protected void btnDesactivarConfigBancoWD_click(object sendder, EventArgs e)
        {
            Boolean combos = true;

            if (int.Parse(hddConfiguracionBanco.Value) > 0)
            {
                combos = false;
            }
            AutWD.Checked = bool.Parse(hddAut.Value);
            BlockControls(!AutWD.Checked, combos);
            string msg = "";

            try
            {
                msg = new Actions().DesactivarConfigBanco(Convert.ToInt32(hddConfiguracionBanco.Value));
            }
            catch (Exception err)
            {
                msg = err.Message;
            }
            CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel2, "<script type='text/javascript'>alert('" + msg + "');</script>");
        }
 protected void BotonGuardar_click(object sender, EventArgs e)
 {
     try
     {
         String       id           = hID.Value.ToString();
         String       cod_ct       = hCodCT.Value.ToString();
         String       cod_empleado = hCodEmpleado.Value.ToString();
         String       cod_desde    = hCodDesde.Value.ToString();
         String       cod_hasta    = hCodHasta.Value.ToString();
         DropDownList cmbPlanta    = ((DropDownList)Page.Master.FindControl("cmbPlanta"));
         String       resp         = new CodigoBarras().InsertCodigoBarras(id, dllPlanta.SelectedValue.ToString(), cod_ct, "1", cod_empleado, cod_desde, cod_hasta);
         if (resp.Length > 3)
         {
             CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel1, "<script type='text/javascript'>alert('" + resp + "');</script>");
         }
     }
     catch (Exception err)
     {
         CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel1, "<script type='text/javascript'>alert('" + err.Message + "');</script>");
     }
     llenaGrid();
 }
Example #20
0
        protected void BotonEliminar_click(object sender, EventArgs e)
        {
            svcSCPP.SCPPClient svc = new svcSCPP.SCPPClient();
            LAMOSA.SCPP.Server.BusinessEntity.RutaProceso rp = new LAMOSA.SCPP.Server.BusinessEntity.RutaProceso();

            try
            {
                DropDownList cmbPlanta = ((DropDownList)Page.Master.FindControl("cmbPlanta"));
                rp.CodPlanta  = int.Parse(cmbPlanta.SelectedValue);
                rp.CodProceso = int.Parse(hddProcesoT.Value);
                rp            = svc.EliminaRutaProceso(rp);
                llenaGrid();
                if (rp.ExceptionMessage != null && rp.ExceptionMessage.Length > 1)
                {
                    CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel1, "<script type='text/javascript'>alert('" + rp.ExceptionMessage + "');</script>");
                }
            }
            catch (Exception err)
            {
                throw err;
            }
        }
        protected void BuscarCodigo(object sender, EventArgs e)
        {
            svcSCPP.SCPPClient svc = new svcSCPP.SCPPClient();

            var code = TxtCode.Text;

            if (code == "")
            {
                CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel1, "<script type='text/javascript'>alert('Debe ingresar un código');</script>");
            }
            else
            {
                List <Common.SolutionEntityFramework.BaseSolutionEntity> Lista = svc.ObtenerKardexProductoBusqueda(TxtCode.Text);
                BE.KardexProductoBusqueda kpb = Lista[0] as BE.KardexProductoBusqueda;
                TxtPlanta1.Text   = kpb.DesPlanta;
                TxtColor.Text     = kpb.Color;
                TxtTipoArt.Text   = kpb.DesTipoArticulo;
                TxtCalidad.Text   = kpb.Calidad;
                TxtModelo.Text    = kpb.DesArticulo;
                TextCodPieza.Text = (kpb.CodPieza.ToString());
                llenargrid();
            }
        }
        protected void btnEliminarWD_click(object sendder, EventArgs e)
        {
            try
            {
                svcSCPP.SCPPClient svc = new svcSCPP.SCPPClient();
                LAMOSA.SCPP.Server.BusinessEntity.ConfigBancos cbr = new LAMOSA.SCPP.Server.BusinessEntity.ConfigBancos();
                cbr.CodConfigBanco = int.Parse(hddConfiguracionBanco.Value);
                cbr = svc.EliminaConfigBanco(cbr);
                if (cbr.ExceptionMessage.Length > 1)
                {
                    UltraWebGrid1.DataSource = svc.ObtenerConfiguracionBancoDetalle(int.Parse(hddConfiguracionBanco.Value));
                    UltraWebGrid1.DataBind();

                    ConfigTablaWD();

                    throw new Exception("El banco se eliminó con éxito");
                }
            }
            catch (Exception err)
            {
                CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel2, "<script type='text/javascript'>alert('" + err.Message + "');</script>");
            }
        }
Example #23
0
        protected void btnAjusteAutomatico_Click(object sender, EventArgs e)
        {
            String msg = "";

            try
            {
                Usuario user = (Usuario)Session["UserLogged"];
                if (user != null)
                {
                    if (UltraWebGrid2.Rows.Count > 0)
                    {
                        int idInv = Convert.ToInt32(UltraWebGrid2.Rows[0].Cells[0].Value.ToString());
                        msg = new server.Inventarios().InventarioEnProcesoAjusteAutomatico(user.CodUsuario, idInv);
                    }
                }
            }
            catch
            {
                msg = "Hubo un problema al generar el Inventario, intente nuevamente.";
            }
            CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel2, "<script type='text/javascript'>alert('" + msg + "');</script>");
            btnBuscaDetalle_Click(null, null);
        }
Example #24
0
        protected void btnCambiaContrasena_Click(object sender, EventArgs e)
        {
            svcSCPP.SCPPClient svc         = new svcSCPP.SCPPClient();
            string             ContraAnt   = ContrasenaAnt.Text;
            string             ContraNueva = ContrasenaNueva.Text;
            Usuario            user        = (Usuario)Session["UserLogged"];
            var CodUser = user.CodUsuario;

            LAMOSA.SCPP.Server.BusinessEntity.ContrasenaC C = new LAMOSA.SCPP.Server.BusinessEntity.ContrasenaC();
            try
            {
                C.codUsuario = CodUser;
                if (string.IsNullOrEmpty(ContraAnt) & string.IsNullOrEmpty(ContraNueva))
                {
                    ContraAnt = ContraNueva = "Lamosa06";
                }
                C.Contrasena      = ContraAnt;
                C.ContrasenaNueva = ContraNueva;
                C = svc.CambiarContrasena(C);
                string msj = C.ExceptionMessage;
                if (C.ExceptionMessage != null && C.ExceptionMessage.Length > 30)
                {
                    CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel1, "<script type='text/javascript'>alert('" + C.ExceptionMessage + "');</script>");
                    //Page.ClientScript.RegisterStartupScript(this.GetType(), "ButtonClickScript", "<script>alert('" + C.ExceptionMessage + "');</script>", false);
                }
                else
                {
                    CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel1, "<script type='text/javascript'>alert('" + C.ExceptionMessage + "');</script>");
                    //Page.ClientScript.RegisterStartupScript(this.GetType(), "ButtonClickScript", "<script>alert('" + C.ExceptionMessage + "');</script>", false);
                }
            }
            catch (Exception err)
            {
                CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel1, "<script type='text/javascript'>alert('" + err.Message + "');</script>");
                //Page.ClientScript.RegisterStartupScript(this.GetType(), "ButtonClickScript", "<script>alert('" + err.Message + "');</script>", false);
            }
        }
        protected void btnBuscar_click(object sender, EventArgs e)
        {
            try
            {
                DropDownList       cmbPlanta = ((DropDownList)Page.Master.FindControl("cmbPlanta"));
                svcSCPP.SCPPClient svc       = new svcSCPP.SCPPClient();
                int planta     = int.Parse(cmbPlanta.SelectedValue);
                int centroTrab = int.Parse(cmbCentroTrabajo.SelectedValue);
                int maquina    = int.Parse(cmbMaquina.SelectedValue);
                int active     = Convert.ToInt32(ddlActivos.SelectedValue);
                List <Common.SolutionEntityFramework.BaseSolutionEntity> Lista = svc.ObtenerConfiguracionBanco(planta, centroTrab, maquina, active);
                UltraWebGrid2.DataSource = Lista;
                if (Lista.Count <= 0)
                {
                    llenarvacio();
                }
                else
                {
                    UltraWebGrid2.ResetColumns();
                    UltraWebGrid2.DataBind();
                    UltraWebGrid2.DisplayLayout.ScrollBar = ScrollBar.Auto;

                    UltraWebGrid2.Columns[0].Header.Caption  = "Centro de trabajo";
                    UltraWebGrid2.Columns[1].Header.Caption  = "Banco";
                    UltraWebGrid2.Columns[2].Header.Caption  = "Límite de vaciadas";
                    UltraWebGrid2.Columns[3].Header.Caption  = "Vaciadas acumuladas";
                    UltraWebGrid2.Columns[4].Header.Caption  = "Fecha inicio";
                    UltraWebGrid2.Columns[5].Header.Caption  = "Fecha fin";
                    UltraWebGrid2.Columns[6].Header.Caption  = "Autorizado";
                    UltraWebGrid2.Columns[7].Header.Caption  = "Autoriza";
                    UltraWebGrid2.Columns[8].Header.Caption  = "Activo";
                    UltraWebGrid2.Columns[9].Header.Caption  = "CodCT";
                    UltraWebGrid2.Columns[10].Header.Caption = "CodMaquina";
                    UltraWebGrid2.Columns[11].Header.Caption = "CodUsuarioAutoriza";
                    UltraWebGrid2.Columns[12].Header.Caption = "CodUsuarioAlta";
                    UltraWebGrid2.Columns[13].Header.Caption = "CodConfigBanco";
                    UltraWebGrid2.Columns[14].Header.Caption = "ExceptionMessage";

                    UltraWebGrid2.Columns[0].Header.Style.Wrap = true;
                    UltraWebGrid2.Columns[2].Header.Style.Wrap = true;
                    UltraWebGrid2.Columns[3].Header.Style.Wrap = true;


                    UltraWebGrid2.Columns[6].Width = 80;
                    UltraWebGrid2.Columns[7].Width = 130;
                    UltraWebGrid2.Columns[8].Width = 70;

                    UltraWebGrid2.Columns[0].Width = 150;
                    UltraWebGrid2.Columns[1].Width = 150;

                    UltraWebGrid2.Columns[4].Width = 90;
                    UltraWebGrid2.Columns[5].Width = 90;


                    UltraWebGrid2.Columns[0].AllowResize = AllowSizing.Fixed;
                    UltraWebGrid2.Columns[1].AllowResize = AllowSizing.Fixed;
                    UltraWebGrid2.Columns[2].AllowResize = AllowSizing.Fixed;
                    UltraWebGrid2.Columns[3].AllowResize = AllowSizing.Fixed;
                    UltraWebGrid2.Columns[4].AllowResize = AllowSizing.Fixed;
                    UltraWebGrid2.Columns[5].AllowResize = AllowSizing.Fixed;
                    UltraWebGrid2.Columns[6].AllowResize = AllowSizing.Fixed;
                    UltraWebGrid2.Columns[7].AllowResize = AllowSizing.Fixed;
                    UltraWebGrid2.Columns[8].AllowResize = AllowSizing.Fixed;

                    UltraWebGrid2.Columns[0].CellStyle.HorizontalAlign = HorizontalAlign.Left;
                    UltraWebGrid2.Columns[1].CellStyle.HorizontalAlign = HorizontalAlign.Left;
                    UltraWebGrid2.Columns[2].CellStyle.HorizontalAlign = HorizontalAlign.Center;
                    UltraWebGrid2.Columns[3].CellStyle.HorizontalAlign = HorizontalAlign.Center;
                    UltraWebGrid2.Columns[4].CellStyle.HorizontalAlign = HorizontalAlign.Center;
                    UltraWebGrid2.Columns[5].CellStyle.HorizontalAlign = HorizontalAlign.Center;
                    UltraWebGrid2.Columns[6].CellStyle.HorizontalAlign = HorizontalAlign.Center;
                    UltraWebGrid2.Columns[7].CellStyle.HorizontalAlign = HorizontalAlign.Left;
                    UltraWebGrid2.Columns[8].CellStyle.HorizontalAlign = HorizontalAlign.Center;

                    UltraWebGrid2.Columns[0].Header.Style.HorizontalAlign = HorizontalAlign.Center;
                    UltraWebGrid2.Columns[1].Header.Style.HorizontalAlign = HorizontalAlign.Center;
                    UltraWebGrid2.Columns[2].Header.Style.HorizontalAlign = HorizontalAlign.Center;
                    UltraWebGrid2.Columns[3].Header.Style.HorizontalAlign = HorizontalAlign.Center;
                    UltraWebGrid2.Columns[4].Header.Style.HorizontalAlign = HorizontalAlign.Center;
                    UltraWebGrid2.Columns[5].Header.Style.HorizontalAlign = HorizontalAlign.Center;
                    UltraWebGrid2.Columns[6].Header.Style.HorizontalAlign = HorizontalAlign.Center;
                    UltraWebGrid2.Columns[7].Header.Style.HorizontalAlign = HorizontalAlign.Center;
                    UltraWebGrid2.Columns[8].Header.Style.HorizontalAlign = HorizontalAlign.Center;

                    UltraWebGrid2.Columns[4].Format = "dd-MM-yyyy";
                    UltraWebGrid2.Columns[5].Format = "dd-MM-yyyy";

                    UltraWebGrid2.Columns[2].Hidden  = true;
                    UltraWebGrid2.Columns[3].Hidden  = true;
                    UltraWebGrid2.Columns[9].Hidden  = true;
                    UltraWebGrid2.Columns[10].Hidden = true;
                    UltraWebGrid2.Columns[11].Hidden = true;
                    UltraWebGrid2.Columns[12].Hidden = true;
                    UltraWebGrid2.Columns[13].Hidden = true;
                    UltraWebGrid2.Columns[14].Hidden = true;
                    UltraWebGrid2.Width = 800;
                }
            }
            catch (Exception ex)
            {
                CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel1, "<script type='text/javascript'>alert('No se encontraron datos');</script>");
            }
        }
Example #26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                svcSCPPHH.SCPP_HHClient d = new svcSCPPHH.SCPP_HHClient();
                BC.SCPP_HH bc             = new BC.SCPP_HH();
                DataSet    ds             = new DataSet();//d.SyncServHH(DropDownList1.SelectedValue.ToString(), DateTime.Today.Date.AddDays(-20), DateTime.Today, DateTime.Today);
                //DataSet ds = bc.SyncServHH(DropDownList1.SelectedValue.ToString(), DateTime.Today.Date.AddDays(-20), DateTime.Today, DateTime.Today);
                //List<DataSet> lds = d.SyncServHHLDS(DateTime.Today.Date.AddDays(-30), DateTime.Today, DateTime.Today);
                //List<StringReader[]> lxmlDS = bc.SyncServHH(DateTime.Today.Date.AddDays(-30), DateTime.Today, DateTime.Today);
                //DataSet beRes = new DataSet();
                //List<DataSet> lds = new List<DataSet>();
                //foreach (StringReader[] xmlSR in lxmlDS)
                //{
                //    beRes.Clear();
                //    beRes = new DataSet();
                //    beRes.ReadXmlSchema(xmlSR[0]);
                //    beRes.ReadXml(xmlSR[1], XmlReadMode.Auto);
                //    lds.Add(beRes);
                //}
                //DataTable dt = d.TablasCatalogosHH();

                DataTable dt = null;
                try
                {
                    dt = d.Login("a", "a");
                }
                catch { }
                try
                { dt = d.ObtenerSupervisorPorDefecto(42); }
                catch { }
                DataSet xmlDS = new DataSet();
                DataSet ds2   = new DataSet();
                try
                {
                    StringReader   xmlSchema  = new StringReader(ds.GetXmlSchema().ToString());
                    StringReader   xmlInfo    = new StringReader(ds.GetXml().ToString());
                    StringReader[] xmlDataSet = { xmlSchema, xmlInfo };

                    ds2.ReadXmlSchema(xmlDataSet[0]);
                    ds2.ReadXml(xmlDataSet[1], XmlReadMode.Auto);
                }
                catch { }

                if (ds2.Tables.Count > 0)
                {
                    UltraWebGrid1.DataSource = ds2.Tables[0];
                    String tableName = ds2.Tables[1].TableName.Substring(3).ToString();
                    ObtenerUpdate(ds2.Tables[1], tableName);
                    UltraWebGrid2.DataSource = ds2.Tables[1];
                    UltraWebGrid3.DataSource = ds2.Tables[2];
                }
                int i = d.ActualizarColorPieza(21, 3);
                UltraWebGrid1.DataBind();
                UltraWebGrid2.DataBind();
                UltraWebGrid3.DataBind();
            }
            catch (Exception er)
            {
                CallBackManager.AddScriptBlock(this.Page, WebAsyncRefreshPanel1, "<script type='text/javascript'>alert('" + er.Message.Replace("'", "\"") + "');</script>");
                Console.Write("Error:" + er.Message);
            }
        }