示例#1
0
        private void cmdAgregar_Click(object sender, EventArgs e)
        {
            ArrayList IDCargo = new ArrayList();
            ArrayList Cargo   = new ArrayList();
            ArrayList Monto   = new ArrayList();

            if (txtCargo.Text == "")
            {
                MessageBoxAdv.Show("Debe de ingresar el cargo", "Información", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                txtCargo.Focus();
                return;
            }
            if (MayorACero(txtMonto.Text.ToString()) == false)
            {
                MessageBoxAdv.Show("Debe de ingresar el monto", "Información", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                txtMonto.Focus();
                return;
            }

            WSMantenimientos.WSMantenimientos WSMAnt = new WSMantenimientos.WSMantenimientos();
            WSMAnt.Url = mdlGenerales.DireccionWS + "FazServices/WSMantenimientos.asmx";
            IDCargo.Add(0);
            Cargo.Add(txtCargo.Text.ToString());
            Monto.Add(txtMonto.Text.ToString());
            WSMAnt.ActualizaCargos(mdlGenerales.Conexion, IDCargo.ToArray(), Cargo.ToArray(),
                                   Monto.ToArray(), mdlGenerales.STRUsuario);
            MessageBoxAdv.Show("El cargo fue añadido", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
            txtCargo.Text = "";
            CargaGrid();
        }
示例#2
0
        private void CargarCombos()
        {
            DataSet   DSDevuelve = new DataSet();
            DataTable DTTipo     = new DataTable();

            WSMantenimientos.WSMantenimientos WSMant = new WSMantenimientos.WSMantenimientos();
            WSMant.Url = mdlGenerales.DireccionWS + "FazServices/WSMantenimientos.asmx";
            WSComunes.WSComunes WSComun = new WSComunes.WSComunes();
            WSComun.Url = mdlGenerales.DireccionWS + "FazServices/WSComunes.asmx";
            DSDevuelve  = WSMant.DevuelveEmpresaUsuario(mdlGenerales.Conexion, mdlGenerales.STRCodUsuario);
            DTTipo      = DSDevuelve.Tables[0];
            Int32 I = 0;

            foreach (DataRow Row in DTTipo.Rows)
            {
                RucEmpresa.Insert(I, Row[1].ToString());
                cmbEmpresa.Items.Add(Row[2].ToString());
                I = I + 1;
            }
            if (cmbEmpresa.Items.Count > 0)
            {
                cmbEmpresa.SelectedIndex = 0;
            }
            I          = 0;
            DSDevuelve = WSComun.DevuelveTipoDoc(mdlGenerales.Conexion, "0");
            DTTipo     = DSDevuelve.Tables[0];
        }
示例#3
0
 private void cmdNodificar_Click(object sender, EventArgs e)
 {
     try
     {
         ArrayList IDCargo = new ArrayList();
         ArrayList Cargo   = new ArrayList();
         ArrayList Monto   = new ArrayList();
         WSMantenimientos.WSMantenimientos WSMAnt = new WSMantenimientos.WSMantenimientos();
         WSMAnt.Url = mdlGenerales.DireccionWS + "FazServices/WSMantenimientos.asmx";
         for (Int32 Index = 0; Index <= GGCVista.Table.Records.Count - 1; Index++)
         {
             if (Convert.ToInt16(GGCVista.Table.Records[Index].GetValue("Sel").ToString()) == 1)
             {
                 IDCargo.Add(Convert.ToInt32(GGCVista.Table.Records[Index].GetValue("IDCargo").ToString()));
                 Cargo.Add(GGCVista.Table.Records[Index].GetValue("Cargo").ToString());
                 Monto.Add(GGCVista.Table.Records[Index].GetValue("Monto").ToString());
             }
         }
         WSMAnt.ActualizaCargos(mdlGenerales.Conexion, IDCargo.ToArray(), Cargo.ToArray(), Monto.ToArray(), mdlGenerales.STRUsuario);
         MessageBoxAdv.Show("Cargos actualizados", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
         CargaGrid();
     }
     catch (Exception E)
     {
         MessageBoxAdv.Show(E.Message, "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#4
0
        private void cmdAgregar_Click(object sender, EventArgs e)
        {
            ArrayList IDTareaje   = new ArrayList();
            ArrayList Descripcion = new ArrayList();
            ArrayList Unidad      = new ArrayList();
            ArrayList Usuario     = new ArrayList();

            if (txtDescripcion.Text == "")
            {
                MessageBoxAdv.Show("Debe de ingresar la descripción de la tarea", "Información", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                txtDescripcion.Focus();
                return;
            }
            if (txtUnidad.Text == "")
            {
                MessageBoxAdv.Show("Debe de ingresar el tipo de unidad de la tarea", "Información", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                txtUnidad.Focus();
                return;
            }

            WSMantenimientos.WSMantenimientos WSMAnt = new WSMantenimientos.WSMantenimientos();
            WSMAnt.Url = mdlGenerales.DireccionWS + "FazServices/WSMantenimientos.asmx";
            IDTareaje.Add(0);
            Descripcion.Add(txtDescripcion.Text.ToString());
            Unidad.Add(txtUnidad.Text.ToString());
            Usuario.Add(mdlGenerales.STRUsuario);
            WSMAnt.ActualizaTareaje(mdlGenerales.Conexion, IDTareaje.ToArray(), Descripcion.ToArray(),
                                    Unidad.ToArray(), Usuario.ToArray());
            MessageBoxAdv.Show("La tarea fue añadido", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
            txtDescripcion.Text = "";
            txtUnidad.Text      = "";
            CargaGrid();
        }
示例#5
0
        private void cmdNodificar_Click(object sender, EventArgs e)
        {
            try
            {
                ArrayList Correlativo = new ArrayList();
                ArrayList Descripcion = new ArrayList();
                ArrayList Unidad      = new ArrayList();
                ArrayList Reorden     = new ArrayList();
                ArrayList Usuario     = new ArrayList();



                WSMantenimientos.WSMantenimientos WSMAnt = new WSMantenimientos.WSMantenimientos();
                WSMAnt.Url = mdlGenerales.DireccionWS + "FazServices/WSMantenimientos.asmx";
                for (Int32 Index = 0; Index <= GGCVista.Table.Records.Count - 1; Index++)
                {
                    if (Convert.ToInt16(GGCVista.Table.Records[Index].GetValue("Sel").ToString()) == 1)
                    {
                        Correlativo.Add(Convert.ToInt32(GGCVista.Table.Records[Index].GetValue("correlativo").ToString()));
                        Descripcion.Add(GGCVista.Table.Records[Index].GetValue("descripcion").ToString());
                        Unidad.Add(GGCVista.Table.Records[Index].GetValue("unidad").ToString());
                        Reorden.Add(GGCVista.Table.Records[Index].GetValue("ptoreorden").ToString());
                        Usuario.Add(mdlGenerales.STRUsuario);
                    }
                }
                WSMAnt.ActualizaMateriales(mdlGenerales.Conexion, Correlativo.ToArray(), Descripcion.ToArray(), Unidad.ToArray(),
                                           Reorden.ToArray(), Usuario.ToArray());
                MessageBoxAdv.Show("Materiales actualizados", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
                CargaGrid();
            }
            catch (Exception E)
            {
                MessageBoxAdv.Show(E.Message, "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
示例#6
0
 private void cmdNodificar_Click(object sender, EventArgs e)
 {
     try
     {
         ArrayList SIDTipoDoc   = new ArrayList();
         ArrayList SNDoc        = new ArrayList();
         ArrayList SIDRol       = new ArrayList();
         ArrayList SNivel       = new ArrayList();
         ArrayList SNumeroRuc   = new ArrayList();
         string    strNumeroRuc = "";
         string    strIDTipoDoc = "";
         string    strNDoc      = "";
         Element   el           = GGCMain.TableControl.Table.CurrentElement;
         Element   e2           = GGCUsuario.TableControl.Table.CurrentElement;
         if (el != null)
         {
             if (el is GridRecord)
             {
                 DataRowView drv = (el as Record).GetData() as DataRowView;
                 strNumeroRuc = drv[1].ToString(); //show column 2
             }
         }
         if (e2 != null)
         {
             if (e2 is GridRecord)
             {
                 DataRowView drv = (e2 as Record).GetData() as DataRowView;
                 strIDTipoDoc = drv[1].ToString(); //show column 2
                 strNDoc      = drv[3].ToString(); //show column 2
             }
         }
         if (strNumeroRuc == "" || strIDTipoDoc == "" || strNDoc == "")
         {
             MessageBoxAdv.Show("Debe de seleccionar una empresa y un usuario", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
             return;
         }
         WSMantenimientos.WSMantenimientos WSMAnt = new WSMantenimientos.WSMantenimientos();
         WSMAnt.Url = mdlGenerales.DireccionWS + "FazServices/WSMantenimientos.asmx";
         for (Int32 Index = 0; Index <= GGCVista.Table.Records.Count - 1; Index++)
         {
             if (Convert.ToInt16(GGCVista.Table.Records[Index].GetValue("Sel").ToString()) == 1)
             {
                 SIDTipoDoc.Add(strIDTipoDoc);
                 SNDoc.Add(strNDoc);
                 SNumeroRuc.Add(strNumeroRuc);
                 SIDRol.Add(GGCVista.Table.Records[Index].GetValue("IDRol").ToString());
                 SNivel.Add(GGCVista.Table.Records[Index].GetValue("IDNivel").ToString());
             }
         }
         WSMAnt.ActualizaUsuarioEmpresa(mdlGenerales.Conexion, SNumeroRuc.ToArray(), SIDRol.ToArray(),
                                        SNivel.ToArray(), mdlGenerales.STRUsuario, SIDTipoDoc.ToArray(), SNDoc.ToArray());
         MessageBoxAdv.Show("Roles actualizados", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
         CargarGrillas();
     }
     catch (Exception E)
     {
         MessageBoxAdv.Show(E.Message, "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#7
0
 private void CargarRoles()
 {
     WSMantenimientos.WSMantenimientos WSMant = new WSMantenimientos.WSMantenimientos();
     WSMant.Url = mdlGenerales.DireccionWS + "FazServices/WSMantenimientos.asmx";
     WSComunes.WSComunes WSComun = new WSComunes.WSComunes();
     WSComun.Url = mdlGenerales.DireccionWS + "FazServices/WSComunes.asmx";
     DSNivel     = WSMant.DevuelveProveedorAltaUsuario(mdlGenerales.Conexion, mdlGenerales.STRCodUsuario);
     DTNivel     = DSNivel.Tables[0];
 }
示例#8
0
        private void cmdModificar_Click(object sender, EventArgs e)
        {
            try
            {
                string  NDoc    = "";
                string  Login   = "";
                string  Pwd     = "";
                string  Mensaje = "";
                Int16   Estado  = 0;
                Element el      = GGCVista.TableControl.Table.CurrentElement;

                DataSet   DSDevuelveMensaje = new DataSet();
                DataTable DTDevuelveMensaje = new DataTable();
                WSMantenimientos.WSMantenimientos WSMAnt = new WSMantenimientos.WSMantenimientos();
                WSMAnt.Url = mdlGenerales.DireccionWS + "FazServices/WSMantenimientos.asmx";

                if (el != null)
                {
                    if (el is GridRecord)
                    {
                        DataRowView drv = (el as Record).GetData() as DataRowView;
                        NDoc   = drv[1].ToString();                   //show column 2
                        Login  = drv[10].ToString();                  //show column 2
                        Pwd    = drv[11].ToString();                  //show column 2
                        Estado = Convert.ToInt16(drv[12].ToString()); //show column 2
                    }
                }
                if (Estado == 0)
                {
                    MessageBoxAdv.Show("El usuario esta de baja", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }


                DSDevuelveMensaje = WSMAnt.ActualizaUsuario(mdlGenerales.Conexion, NDoc, Login, Pwd, 0);
                DTDevuelveMensaje = DSDevuelveMensaje.Tables[0];
                foreach (DataRow Row in DTDevuelveMensaje.Rows)
                {
                    Mensaje = Row[0].ToString();
                }

                MessageBoxAdv.Show(Mensaje, "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
                CargaGrid();
            }
            catch (Exception E)
            {
                MessageBoxAdv.Show(E.Message, "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
示例#9
0
 private void CargaGrid()
 {
     WSMantenimientos.WSMantenimientos WSMant = new WSMantenimientos.WSMantenimientos();
     WSMant.Url          = mdlGenerales.DireccionWS + "FazServices/WSMantenimientos.asmx";
     DSDevuelve          = WSMant.DevuelveProveedor(mdlGenerales.Conexion);
     DTMain              = DSDevuelve.Tables[0];
     DVMain              = DTMain.DefaultView;
     GGCVista.DataSource = null;
     GGCVista.TableDescriptor.Reset();
     GGCVista.TableDescriptor.AllowNew = false;
     GGCVista.Refresh();
     GGCVista.DataSource = DVMain;
     FormatColumnas();
     AplicarFilterBar();
 }
示例#10
0
        private void cmdAgregar_Click(object sender, EventArgs e)
        {
            ArrayList SNDoc             = new ArrayList();
            ArrayList SLogin            = new ArrayList();
            ArrayList SPWD              = new ArrayList();
            ArrayList SEstado           = new ArrayList();
            String    DNI               = "";
            DataSet   DSDevuelveMensaje = new DataSet();
            DataTable DTDevuelveMensaje = new DataTable();
            string    Mensaje           = "";


            if (txtLogin.Text == "")
            {
                MessageBoxAdv.Show("Debe de ingresar el login", "Información", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                txtLogin.Focus();
                return;
            }
            if (txtPWD.Text == "")
            {
                MessageBoxAdv.Show("Debe de ingresar la contraseña", "Información", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                txtPWD.Focus();
                return;
            }
            WSMantenimientos.WSMantenimientos WSMAnt = new WSMantenimientos.WSMantenimientos();
            WSMAnt.Url = mdlGenerales.DireccionWS + "FazServices/WSMantenimientos.asmx";
            Element el = this.GGCVista.TableControl.Table.CurrentElement;

            if (el != null)
            {
                if (el is GridRecord)
                {
                    DataRowView drv = (el as Record).GetData() as DataRowView;
                    DNI = drv[3].ToString(); //show column 2
                }
            }
            DSDevuelveMensaje = WSMAnt.ActualizaUsuario(mdlGenerales.Conexion, DNI, txtLogin.Text.ToString(), txtPWD.Text.ToString(), 1);
            DTDevuelveMensaje = DSDevuelveMensaje.Tables[0];
            foreach (DataRow Row in DTDevuelveMensaje.Rows)
            {
                Mensaje = Row[0].ToString();
            }

            txtLogin.Text = "";
            txtPWD.Text   = "";
            MessageBoxAdv.Show(Mensaje, "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
            CargaGrid();
        }
示例#11
0
        private void CargaGrid(String NumeroRuc, String IDTipoDoc, String NDoc)
        {
            DataSet   DSDevuelve = new DataSet();
            DataTable DTMain     = new DataTable();
            DataView  DVMain     = new DataView();
            DataTable DTNivel    = new DataTable();
            DataView  DVNivel    = new DataView();

            GGCVista.DataSource = null;
            GGCVista.TableDescriptor.Reset();
            GGCVista.TableDescriptor.AllowNew = false;
            GGCVista.Refresh();

            WSMantenimientos.WSMantenimientos WSMant = new WSMantenimientos.WSMantenimientos();
            WSMant.Url = mdlGenerales.DireccionWS + "FazServices/WSMantenimientos.asmx";
            DSDevuelve = WSMant.DevuelveUsuarioEmpresa(mdlGenerales.Conexion, NumeroRuc, IDTipoDoc, NDoc);
            DTMain     = DSDevuelve.Tables[0];
            DVMain     = DTMain.DefaultView;
            DTNivel    = DSDevuelve.Tables[1];
            DVNivel    = DTNivel.DefaultView;

            GGCVista.TopLevelGroupOptions.ShowFilterBar = false;
            GGCVista.TopLevelGroupOptions.ShowAddNewRecordBeforeDetails = false;
            GGCVista.TopLevelGroupOptions.ShowAddNewRecordAfterDetails  = false;
            //Limpia Grilla
            GGCVista.DataSource = null;
            GGCVista.DataMember = null;
            GGCVista.ResetTableDescriptor();
            GGCVista.TableDescriptor.Relations.Clear();

            GridTableDescriptor mainTD = GGCVista.TableDescriptor;

            /*Relacion Foreign y llenado de combo ojo*/
            GGCVista.Engine.SourceListSet.Add("NivelRelacion", DTNivel);
            GridRelationDescriptor EstadoRd = new GridRelationDescriptor();

            EstadoRd.Name           = "Nivel";
            EstadoRd.RelationKind   = RelationKind.ForeignKeyReference;
            EstadoRd.ChildTableName = "NivelRelacion";  // SourceListSet name for lookup
            EstadoRd.RelationKeys.Add("IDNivel", "IDNivel");
            EstadoRd.ChildTableDescriptor.Appearance.AlternateRecordFieldCell.BackColor = Color.CadetBlue;
            EstadoRd.ChildTableDescriptor.AllowEdit = false;
            EstadoRd.ChildTableDescriptor.AllowNew  = false;
            mainTD.Relations.Add(EstadoRd);
            GGCVista.DataSource = DTMain;
            FormatColumnas();
            AplicarFilterBar();
        }
示例#12
0
        private void cmdAgregar_Click(object sender, EventArgs e)
        {
            ArrayList Correlativo = new ArrayList();
            ArrayList Descripcion = new ArrayList();
            ArrayList Unidad      = new ArrayList();
            ArrayList Reorden     = new ArrayList();
            ArrayList Usuario     = new ArrayList();

            if (txtDescripcion.Text == "")
            {
                MessageBoxAdv.Show("Debe de ingresar el nombre del material", "Información", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                txtDescripcion.Focus();
                return;
            }
            if (txtUnidad.Text == "")
            {
                MessageBoxAdv.Show("Debe de ingresar el tipo de unidad del material", "Información", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                txtUnidad.Focus();
                return;
            }
            if (MayorACero(txtReorden.Text.ToString()))
            {
                MessageBoxAdv.Show("Debe de ingresar el punto de reorden >=0", "Información", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                txtReorden.Focus();
                return;
            }

            WSMantenimientos.WSMantenimientos WSMAnt = new WSMantenimientos.WSMantenimientos();
            WSMAnt.Url = mdlGenerales.DireccionWS + "FazServices/WSMantenimientos.asmx";
            Correlativo.Add(0);
            Descripcion.Add(txtDescripcion.Text.ToString());
            Unidad.Add(txtUnidad.Text.ToString());
            Reorden.Add(txtReorden.Text.ToString());
            Usuario.Add(mdlGenerales.STRUsuario);

            WSMAnt.ActualizaMateriales(mdlGenerales.Conexion, Correlativo.ToArray(), Descripcion.ToArray(),
                                       Unidad.ToArray(), Reorden.ToArray(), Usuario.ToArray());
            MessageBoxAdv.Show("El cargo fue añadido", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
            txtDescripcion.Text = "";
            txtUnidad.Text      = "";
            txtReorden.Text     = "";
            CargaGrid();
        }
示例#13
0
 private void cmdNodificar_Click(object sender, EventArgs e)
 {
     try
     {
         ArrayList SIDRol     = new ArrayList();
         ArrayList SIDTipoDoc = new ArrayList();
         ArrayList SNDoc      = new ArrayList();
         ArrayList SNivel     = new ArrayList();
         Element   el         = GGCMain.TableControl.Table.CurrentElement;
         string    DNI        = "";
         string    IDTipoDoc  = "";
         if (el != null)
         {
             if (el is GridRecord)
             {
                 DataRowView drv = (el as Record).GetData() as DataRowView;
                 DNI       = drv[3].ToString(); //show column 2
                 IDTipoDoc = drv[1].ToString();
             }
         }
         WSMantenimientos.WSMantenimientos WSMAnt = new WSMantenimientos.WSMantenimientos();
         WSMAnt.Url = mdlGenerales.DireccionWS + "FazServices/WSMantenimientos.asmx";
         for (Int32 Index = 0; Index <= GGCVista.Table.Records.Count - 1; Index++)
         {
             if (Convert.ToInt16(GGCVista.Table.Records[Index].GetValue("Sel").ToString()) == 1)
             {
                 SIDRol.Add(GGCVista.Table.Records[Index].GetValue("IDRol").ToString());
                 SNDoc.Add(DNI);
                 SIDTipoDoc.Add(IDTipoDoc);
                 SNivel.Add(GGCVista.Table.Records[Index].GetValue("IDNivel").ToString());
             }
         }
         WSMAnt.ActualizaUsuarioRol(mdlGenerales.Conexion, SIDRol.ToArray(), SIDTipoDoc.ToArray(), SNDoc.ToArray(),
                                    SNivel.ToArray(), mdlGenerales.STRUsuario);
         MessageBoxAdv.Show("Roles actualizados", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
         CargaGrid(DNI);
     }
     catch (Exception E)
     {
         MessageBoxAdv.Show(E.Message, "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#14
0
        private void cmdModificar_Click(object sender, EventArgs e)
        {
            //try
            {
                ArrayList SIDTipo    = new ArrayList();
                ArrayList SNDoc      = new ArrayList();
                ArrayList SApellidos = new ArrayList();
                ArrayList SNombres   = new ArrayList();
                ArrayList SDireccion = new ArrayList();
                ArrayList Stelefono  = new ArrayList();
                ArrayList SIDCargo   = new ArrayList();
                ArrayList SIDEstado  = new ArrayList();
                WSMantenimientos.WSMantenimientos WSMAnt = new WSMantenimientos.WSMantenimientos();
                WSMAnt.Url = mdlGenerales.DireccionWS + "FazServices/WSMantenimientos.asmx";
                for (Int32 Index = 0; Index <= GGCVista.Table.Records.Count - 1; Index++)
                {
                    if (Convert.ToInt16(GGCVista.Table.Records[Index].GetValue("Sel").ToString()) == 1)
                    {
                        SIDTipo.Add(Convert.ToInt16(GGCVista.Table.Records[Index].GetValue("idtipodoc").ToString()));
                        SNDoc.Add(GGCVista.Table.Records[Index].GetValue("NDoc").ToString());
                        SApellidos.Add(GGCVista.Table.Records[Index].GetValue("Apellidos").ToString());
                        SNombres.Add(GGCVista.Table.Records[Index].GetValue("Nombre").ToString());
                        SDireccion.Add(GGCVista.Table.Records[Index].GetValue("Direccion").ToString());
                        Stelefono.Add(GGCVista.Table.Records[Index].GetValue("Telefono").ToString());
                        SIDCargo.Add(Convert.ToInt16(GGCVista.Table.Records[Index].GetValue("IDCargo").ToString()));
                        SIDEstado.Add(Convert.ToInt16(GGCVista.Table.Records[Index].GetValue("IDEstado").ToString()));
                    }
                }
                WSMAnt.ActualizaPersonal(mdlGenerales.Conexion, SIDTipo.ToArray(),
                                         SNDoc.ToArray(), SApellidos.ToArray(),
                                         SNombres.ToArray(), SDireccion.ToArray(),
                                         Stelefono.ToArray(), SIDEstado.ToArray(),
                                         SIDCargo.ToArray());
                MessageBoxAdv.Show("Personal actualizado", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
                CargaGrid();
            }

            /*catch (Exception E)
             * {
             *  MessageBoxAdv.Show(E.Message, "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
             * }*/
        }
示例#15
0
        private void CargaMain()
        {
            DataSet   DSDevuelve = new DataSet();
            DataTable DTDevuelve = new DataTable();
            DataView  DVDevuelve = new DataView();

            WSMantenimientos.WSMantenimientos WSMant = new WSMantenimientos.WSMantenimientos();
            WSMant.Url = mdlGenerales.DireccionWS + "FazServices/WSMantenimientos.asmx";

            DSDevuelve         = WSMant.DevuelveEmpresaPropiasAlta(mdlGenerales.Conexion);
            DTDevuelve         = DSDevuelve.Tables[0];
            DVDevuelve         = DTDevuelve.DefaultView;
            GGCMain.DataSource = null;
            GGCMain.TableDescriptor.Reset();
            GGCMain.TableDescriptor.AllowNew = false;
            GGCMain.Refresh();
            GGCMain.DataSource = DVDevuelve;
            FormatColumnasMain();
            AplicarFilterBarMain();
        }
示例#16
0
        private void cmdAgregar_Click(object sender, EventArgs e)
        {
            ArrayList IDZona = new ArrayList();
            ArrayList Zona   = new ArrayList();

            if (txtZona.Text == "")
            {
                MessageBoxAdv.Show("Debe de ingresar la contraseña", "Información", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                txtZona.Focus();
                return;
            }

            WSMantenimientos.WSMantenimientos WSMAnt = new WSMantenimientos.WSMantenimientos();
            WSMAnt.Url = mdlGenerales.DireccionWS + "FazServices/WSMantenimientos.asmx";
            IDZona.Add(0);
            Zona.Add(txtZona.Text.ToString());
            WSMAnt.ActualizaZona(mdlGenerales.Conexion, IDZona.ToArray(), Zona.ToArray(), mdlGenerales.STRUsuario);
            MessageBoxAdv.Show("La zona fua añadida", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
            CargaGrid();
        }
示例#17
0
        private void cmdModificar_Click(object sender, EventArgs e)
        {
            DataSet   DSDevuelveID = new DataSet();
            DataTable DTDevuelveID = new DataTable();

            if (txtRuc.Text.ToString() == "")
            {
                MessageBoxAdv.Show("Debe de registrar el número de Ruc del proveedor", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtRuc.Focus();
                return;
            }
            if (txtRazonSocial.Text.ToString() == "")
            {
                MessageBoxAdv.Show("Debe de registrar la Razón Social del proveedor", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtRazonSocial.Focus();
                return;
            }
            Int32 intCondicion = 0;

            if (rbAlta.Checked == true)
            {
                intCondicion = 1;
            }
            else
            {
                intCondicion = 0;
            }

            WSMantenimientos.WSMantenimientos WSMant = new WSMantenimientos.WSMantenimientos();
            WSMant.Url   = mdlGenerales.DireccionWS + "FazServices/WSMantenimientos.asmx";
            DSDevuelveID = WSMant.ActualizaProveedor(mdlGenerales.Conexion,
                                                     txtRuc.Text.ToString(), txtRazonSocial.Text.ToString(),
                                                     txtDireccion.Text.ToString(), txtTelefono1.Text.ToString(),
                                                     txtTelefono2.Text.ToString(), txtEmail.Text.ToString(),
                                                     txtContacto.Text.ToString(), intCondicion.ToString(),
                                                     mdlGenerales.STRUsuario);
            DTDevuelveID = DSDevuelveID.Tables[0];
            Limpiar();
            MessageBoxAdv.Show("Se actualizo el proveedor", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
            CargaGrid();
        }
示例#18
0
 private void VerificarWS()
 {
     try
     {
         WSMantenimientos.WSMantenimientos clsLog = new WSMantenimientos.WSMantenimientos();
         clsLog.Url = mdlGenerales.DireccionWSExt + "FazServices/WSMantenimientos.asmx";
         String Result = clsLog.VerificaWS();
         if (Result == "Ok")
         {
             mdlGenerales.DireccionWS = mdlGenerales.DireccionWSExt;
         }
         else
         {
             mdlGenerales.DireccionWS = mdlGenerales.DireccionWSInt;
         }
     }
     catch (Exception)
     {
         mdlGenerales.DireccionWS = mdlGenerales.DireccionWSInt;
         //MessageBoxAdv.Show(Ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
示例#19
0
        private void cmdAgregar_Click(object sender, EventArgs e)
        {
            ArrayList SIDTipo    = new ArrayList();
            ArrayList SNDoc      = new ArrayList();
            ArrayList SApellidos = new ArrayList();
            ArrayList SNombres   = new ArrayList();
            ArrayList SDireccion = new ArrayList();
            ArrayList Stelefono  = new ArrayList();
            ArrayList SIDCargo   = new ArrayList();
            ArrayList SIDEstado  = new ArrayList();

            WSMantenimientos.WSMantenimientos WSMAnt = new WSMantenimientos.WSMantenimientos();
            WSMAnt.Url = mdlGenerales.DireccionWS + "FazServices/WSMantenimientos.asmx";

            SIDTipo.Add(IDTipo[Convert.ToInt32(cmbTipo.SelectedIndex.ToString())].ToString());
            SNDoc.Add(txtNDoc.Text.ToString());
            SApellidos.Add(txtApellidos.Text.ToString());
            SNombres.Add(txtNombres.Text.ToString());
            SDireccion.Add(txtDireccion.Text.ToString());
            Stelefono.Add(txtTelefono.Text.ToString());
            SIDCargo.Add(IDCargo[Convert.ToInt32(cmbCargo.SelectedIndex.ToString())].ToString());
            SIDEstado.Add(IDEstado[Convert.ToInt32(cmbCondicion.SelectedIndex.ToString())].ToString());

            WSMAnt.ActualizaPersonal(mdlGenerales.Conexion, SIDTipo.ToArray(), SNDoc.ToArray(), SApellidos.ToArray(),
                                     SNombres.ToArray(), SDireccion.ToArray(), Stelefono.ToArray(), SIDEstado.ToArray(),
                                     SIDCargo.ToArray());

            cmbTipo.SelectedIndex      = 0;
            txtNDoc.Text               = "";
            txtApellidos.Text          = "";
            txtNombres.Text            = "";
            txtDireccion.Text          = "";
            txtTelefono.Text           = "";
            cmbCondicion.SelectedIndex = 0;
            cmbCargo.SelectedIndex     = 0;
            MessageBoxAdv.Show("El personal fue añadido", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
            CargaGrid();
        }
示例#20
0
        private void cmdModificar_Click(object sender, EventArgs e)
        {
            WSMantenimientos.WSMantenimientos WSMAnt = new WSMantenimientos.WSMantenimientos();
            WSMAnt.Url = mdlGenerales.DireccionWS + "FazServices/WSMantenimientos.asmx";
            if (txtPwdOld.Text.ToString() == "")
            {
                MessageBoxAdv.Show("Debe de ingresar la clave anterior", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtPwdOld.Focus();
                return;
            }
            if (txtPwdNew.Text.ToString() == "")
            {
                MessageBoxAdv.Show("Debe de ingresar la clave nueva", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtPwdNew.Focus();
                return;
            }
            if (txtPwdNew1.Text.ToString() == "")
            {
                MessageBoxAdv.Show("Debe de re-ingresar la clave nueva", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtPwdNew1.Focus();
                return;
            }

            if (txtPwdOld.Text.ToString() != mdlGenerales.STRPwd.ToString())
            {
                MessageBoxAdv.Show("La clave anterior es erronea", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtPwdOld.Focus();
                return;
            }
            if (txtPwdNew.Text.ToString() != txtPwdNew1.Text.ToString())
            {
                MessageBoxAdv.Show("No coincide la clave nueva", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtPwdNew.Focus();
                return;
            }
            WSMAnt.CambiaPWD(mdlGenerales.Conexion, mdlGenerales.STRCodUsuario, mdlGenerales.STRLogin, txtPwdNew1.Text.ToString());
            MessageBoxAdv.Show("Se realizo el cambio de password", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
示例#21
0
        private void CargaCombos()
        {
            DataSet   DSNivel = new DataSet();
            DataTable DTNivel = new DataTable();

            WSMantenimientos.WSMantenimientos WSMant = new WSMantenimientos.WSMantenimientos();
            WSMant.Url = mdlGenerales.DireccionWS + "FazServices/WSMantenimientos.asmx";
            DSNivel    = WSMant.DevuelveEmpresaPropias(mdlGenerales.Conexion);
            DTNivel    = DSNivel.Tables[0];
            Int32 I = 0;

            foreach (DataRow Row in DTNivel.Rows)
            {
                RucEmpresa.Insert(I, Row[2].ToString());
                cmbEmpresa.Items.Add(Row[3].ToString());
                I = I + 1;
            }
            if (cmbEmpresa.Items.Count > 0)
            {
                cmbEmpresa.SelectedIndex = 0;
            }
            I = 0;
        }
示例#22
0
        private void PBLogo_DoubleClick(object sender, EventArgs e)
        {
            String    strResultado = "";
            Int32     intResultado = 0;
            String    LRuc         = "";
            DataSet   DSDevuelveID = new DataSet();
            DataTable DTDevuelveID = new DataTable();

            WSMantenimientos.WSMantenimientos WSMant = new WSMantenimientos.WSMantenimientos();
            WSMant.Url = mdlGenerales.DireccionWS + "FazServices/WSMantenimientos.asmx";
            Element el = GGCVista.TableControl.Table.CurrentElement;

            if (el != null)
            {
                if (el is GridRecord)
                {
                    DataRowView drv = (el as Record).GetData() as DataRowView;
                    LRuc = drv[2].ToString(); //show column 2
                }
            }

            if (LRuc == "")
            {
                MessageBoxAdv.Show("Debe de seleccionar la empresa", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            string NombreArchivo = string.Concat("LOGOEMP_" + LRuc);

            NombreArchivo = NombreArchivo.Replace(" ", "");
            string extension = "";

            /*************************
            * Subiendo foto
            *************************/
            var dlg = new OpenFileDialog
            {
                Filter          = @"JPEG files (*.jpg)|*.jpg",
                CheckFileExists = true,
                Title           = @"Seleccione la foto",
                Multiselect     = false
            };

            ;
            if (dlg.ShowDialog() == DialogResult.OK) // Test result.
            {
                FileInfo fi = new FileInfo(dlg.FileName);
                if (fi.Exists)
                {
                    extension = fi.Extension.ToString();
                    fi.CopyTo(dlg.FileName.Replace(dlg.SafeFileName, "") + NombreArchivo + extension);
                }

                //aqui me quedo

                UploadFoto(dlg.FileName.Replace(dlg.SafeFileName, "") + NombreArchivo + extension, "");
                File.Delete(dlg.FileName.Replace(dlg.SafeFileName, "") + NombreArchivo + extension);
            }
            else
            {
                MessageBoxAdv.Show("Se cancelo el registro", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            /************************************
            * Registrando logo en BD
            ************************************/
            DSDevuelveID = WSMant.ActualizaLogoEmpresa(mdlGenerales.Conexion,
                                                       LRuc, NombreArchivo + extension, mdlGenerales.STRUsuario);
            DTDevuelveID = DSDevuelveID.Tables[0];
            foreach (DataRow Row in DTDevuelveID.Rows)
            {
                intResultado = Convert.ToInt32(Row[0].ToString());
                strResultado = Row[1].ToString();
            }

            if (intResultado == 0)
            {
                MessageBoxAdv.Show(strResultado, "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
                Limpiar();
                CargaGrid();
            }
            else
            {
                MessageBoxAdv.Show(strResultado, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#23
0
        private void miCargar_Click(object sender, EventArgs e)
        {
            try
            {
                string    sUrl     = mdlGenerales.PagTC;
                String    Conexion = "Server=" + mdlGenerales.Server + ";Database=faz;Uid=tc;Pwd=tc;";
                ArrayList TCFecha  = new ArrayList();
                ArrayList TCCompra = new ArrayList();
                ArrayList TCVenta  = new ArrayList();

                Encoding objEncoding = Encoding.GetEncoding("ISO-8859-1");
                //WebProxy objWebProxy = new WebProxy("proxy", 80);
                CookieCollection objCookies = new CookieCollection();

                //USANDO GET
                HttpWebRequest getRequest = (HttpWebRequest)WebRequest.Create(sUrl);
                //getRequest.Proxy = objWebProxy;
                getRequest.Credentials     = CredentialCache.DefaultNetworkCredentials;
                getRequest.ProtocolVersion = HttpVersion.Version11;
                getRequest.UserAgent       = ".NET Framework 4.0";
                getRequest.Method          = "GET";

                getRequest.CookieContainer = new CookieContainer();
                getRequest.CookieContainer.Add(objCookies);

                string sGetResponse = string.Empty;

                using (HttpWebResponse getResponse = (HttpWebResponse)getRequest.GetResponse())
                {
                    objCookies = getResponse.Cookies;

                    using (StreamReader srGetResponse = new StreamReader(getResponse.GetResponseStream(), objEncoding))
                    {
                        sGetResponse = srGetResponse.ReadToEnd();
                    }
                }
                HtmlAgilityPack.HtmlDocument document = new HtmlAgilityPack.HtmlDocument();
                document.LoadHtml(sGetResponse);
                HtmlNodeCollection NodesTr = document.DocumentNode.SelectNodes("//table[@class='class=\"form-table\"']//tr");
                if (NodesTr != null)
                {
                    DataTable dt = new DataTable();
                    dt.Columns.Add("Día", typeof(String));
                    dt.Columns.Add("Compra", typeof(String));
                    dt.Columns.Add("Venta", typeof(String));
                    int iNumFila = 0;
                    foreach (HtmlNode Node in NodesTr)
                    {
                        if (iNumFila > 0)
                        {
                            int     iNumColumna = 0;
                            DataRow dr          = dt.NewRow();
                            foreach (HtmlNode subNode in Node.Elements("td"))
                            {
                                if (iNumColumna == 0)
                                {
                                    dr = dt.NewRow();
                                }
                                string sValue = subNode.InnerHtml.ToString().Trim();
                                sValue          = System.Text.RegularExpressions.Regex.Replace(sValue, "<.*?>", " ");
                                dr[iNumColumna] = sValue;
                                iNumColumna++;
                                if (iNumColumna == 3)
                                {
                                    dt.Rows.Add(dr);
                                    iNumColumna = 0;
                                }
                            }
                        }
                        iNumFila++;
                    }
                    Int32    I     = 0;
                    DateTime Fecha = DateTime.Now;
                    dt.AcceptChanges();

                    foreach (DataRow Row in dt.Rows)
                    {
                        Fecha = Convert.ToDateTime(DateTime.Now.Year.ToString() + "/" + DateTime.Now.Month.ToString() + "/" + Row[0].ToString());
                        TCFecha.Insert(I, Fecha.ToString("yyyy/MM/dd 00:00:00"));
                        TCCompra.Insert(I, Convert.ToDouble(Row[1].ToString()));
                        TCVenta.Insert(I, Convert.ToDouble(Row[2].ToString()));
                        I = I + 1;
                    }
                    WSMantenimientos.WSMantenimientos WSMAnt = new WSMantenimientos.WSMantenimientos();
                    WSMAnt.Url = mdlGenerales.DireccionWS + "FazServices/WSMantenimientos.asmx";

                    WSMAnt.AgregaCambioHistorico(Conexion, TCFecha.ToArray(),
                                                 TCCompra.ToArray(), TCVenta.ToArray());
                    WSMAnt.CompruebaCambioHistorico(Conexion);
                }
            }
            catch (Exception Ex)
            {
                String Conexion = "Server=" + mdlGenerales.Server + ";Database=faz;Uid=tc;Pwd=tc;";
                WSMantenimientos.WSMantenimientos WSMAnt = new WSMantenimientos.WSMantenimientos();
                WSMAnt.Url = mdlGenerales.DireccionWS + "FazServices/WSMantenimientos.asmx";
                WSMAnt.AddErrorTC(Conexion, Ex.Message);
            }
        }