Beispiel #1
0
        private void EjecutarSP()
        {
            //Envio de correo

            int id = Convert.ToInt32(Session["id1"]);

            DataSetTableAdapters.Solicitud_mTableAdapter obj = new DataSetTableAdapters.Solicitud_mTableAdapter();
            string emailus = obj.Emailxid(Convert.ToString(id)).ToString();


            MailMessage oMsg = new MailMessage();

            //Desde
            oMsg.From = new MailAddress("*****@*****.**");
            //Para
            oMsg.To.Add("" + emailus);
            //Copia
            // oMsg.Bcc.Add("");
            //Asunto
            oMsg.Subject = "Solicitud Comprada";
            //Cuerpo del Mensaje


            oMsg.Body       = "Se ha Comprado su solicitud con el numero de identificar " + id + ", favor retirar en Administracion," + " <br />Para revisar la solicitud, ingrese <a href=http://10.38.60.4/Materiales/Login.aspx> Aqui</a>.";
            oMsg.IsBodyHtml = true;
            SmtpClient smtp = new SmtpClient("emailsrv.falabella.cl");

            smtp.Port = 25;
            smtp.Send(oMsg);
            oMsg.IsBodyHtml = true;
        }
Beispiel #2
0
        private void EjecutarSP()
        {
            DataSetTableAdapters.UsuarioTableAdapter     obj  = new DataSetTableAdapters.UsuarioTableAdapter();
            DataSetTableAdapters.Solicitud_mTableAdapter obj1 = new DataSetTableAdapters.Solicitud_mTableAdapter();

            int    id       = Convert.ToInt32(Session["id"]);
            string emailger = obj.UsuarioCorreo(Session["nom"].ToString()).ToString();
            string emailus  = obj1.Emailxid(Convert.ToString(id)).ToString();


            MailMessage oMsg = new MailMessage();

            //Desde
            oMsg.From = new MailAddress("" + emailger);
            //Para
            oMsg.To.Add("" + emailus);
            //Copia
            oMsg.Bcc.Add("*****@*****.**");
            //Asunto
            oMsg.Subject = "Solicitud Aprobada";
            //Cuerpo del Mensaje



            oMsg.Body       = "Se ha Aprobado la solicitud " + id + " <br />Para revisar la solicitud, ingrese <a href=http://10.38.60.4/Materiales/Login.aspx> Aqui</a>.";
            oMsg.IsBodyHtml = true;
            SmtpClient smtp = new SmtpClient("emailsrv.falabella.cl");

            smtp.Port = 25;
            smtp.Send(oMsg);
            oMsg.IsBodyHtml = true;
        }
Beispiel #3
0
        protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            Session["id"] = int.Parse(this.GridView1.DataKeys[e.RowIndex].Value.ToString());
            RadioButtonList rbl      = (RadioButtonList)this.GridView1.Rows[e.RowIndex].FindControl("RadioButtonList1");
            string          aprobado = Convert.ToString(rbl.SelectedValue);
            int             id       = Convert.ToInt32(Session["id"]);

            if (aprobado == "Aprobado")
            {
                DataSetTableAdapters.Solicitud_ResumenTableAdapter obj = new DataSetTableAdapters.Solicitud_ResumenTableAdapter();
                obj.UpdateActuaEstado(id).ToString();
                Thread t = new Thread(EjecutarSP);
                t.Start();
                Response.Write("<script>alert('Se aceptó la solicitud. Email Enviado.');</script>");
                Thread.Sleep(1000);
            }
            else if (aprobado == "Rechazado")
            {
                DataSetTableAdapters.Solicitud_mTableAdapter obj = new DataSetTableAdapters.Solicitud_mTableAdapter();
                obj.UpdateActuaRechazado(id).ToString();
                Thread t = new Thread(EjecutarSP2);
                t.Start();
                Response.Write("<script>alert('Se rechazó la solicitud. Email Enviado.');</script>");
                Thread.Sleep(1000);
            }
        }
Beispiel #4
0
        protected void BtnIngresar_Click(object sender, EventArgs e)
        {
            string cc, Material, pendiente, fecha, nombre;
            int    cantidad, id_solicitud;

            if (txtcant.Text == "")
            {
                LblEstado.Text = "Ingresar La cantadidad";
            }
            else
            {
                fecha        = DateTime.Today.ToString("dd-MM-yyyy");
                id_solicitud = Convert.ToInt32(Lblid.Text);
                pendiente    = "En Proceso";
                Material     = dlmat.SelectedValue;
                cantidad     = Convert.ToInt32(txtcant.Text);


                //covierte la ref
                DataSetTableAdapters.Listado_MaterialesTableAdapter obj1 = new DataSetTableAdapters.Listado_MaterialesTableAdapter();
                string ing_ref     = obj1.modificarRef(Material).ToString();
                string ing_dec     = obj1.modificarDescrp(Material).ToString();
                string ing_untranf = obj1.unidadTransferencia(Material).ToString();


                //inserta datos
                DataSetTableAdapters.Solicitud_mTableAdapter obj = new DataSetTableAdapters.Solicitud_mTableAdapter();
                string descc = obj.DESCCC(lblcc.Text).ToString();

                obj.InsertMaterial(id_solicitud, lblcc.Text, descc, Session["nom"].ToString(), ing_ref, ing_dec, cantidad, pendiente, fecha, ing_untranf);

                if (cantidad <= 1)
                {
                    //consulta precio y updateo
                    DataSetTableAdapters.PreciosMaterialesTableAdapter obj3 = new DataSetTableAdapters.PreciosMaterialesTableAdapter();
                    string precio = obj3.SelectPrecio(Session["nom"].ToString()).ToString();
                    obj.UpdatePrecio(precio);
                    obj.UpdatePrecioUnitario(precio);
                }
                else
                {
                    //genera suma y total
                    DataSetTableAdapters.PreciosMaterialesTableAdapter obj3 = new DataSetTableAdapters.PreciosMaterialesTableAdapter();
                    string precio          = obj3.SelectPrecio(Session["nom"].ToString()).ToString();
                    int    resultado       = Convert.ToInt32(precio) * cantidad;
                    string resultadostring = Convert.ToString(resultado);
                    obj.UpdatePrecio(resultadostring);
                    obj.UpdatePrecioUnitario(precio);
                }

                txtcant.Text   = "";
                LblEstado.Text = "Ingreso de Material Correcto";
                GridView1.DataBind();
                DataSetTableAdapters.Solicitud_ResumenTableAdapter obj7 = new DataSetTableAdapters.Solicitud_ResumenTableAdapter();
                obj7.UpdateSolicitud_Resu(Lblid.Text);
            }
        }
Beispiel #5
0
        protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            int id = int.Parse(this.GridView1.DataKeys[e.RowIndex].Value.ToString());

            DataSetTableAdapters.Solicitud_mTableAdapter obj = new DataSetTableAdapters.Solicitud_mTableAdapter();
            obj.eliminarTablaDetalleUsuario(id);
            GridView2.DataBind();
            GridView3.DataBind();
            GridView4.DataBind();
        }
Beispiel #6
0
        protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            int             id       = int.Parse(this.GridView1.DataKeys[e.RowIndex].Value.ToString());
            RadioButtonList rbl      = (RadioButtonList)this.GridView1.Rows[e.RowIndex].FindControl("RadioButtonList1");
            string          aprobado = Convert.ToString(rbl.SelectedValue);

            if (aprobado == "En Compra")
            {
                DataSetTableAdapters.Solicitud_mTableAdapter obj = new DataSetTableAdapters.Solicitud_mTableAdapter();
                string updateaprobado = obj.UpdateActuaEstadoEn_Compra(id).ToString();
            }
            else
            {
            }
        }
Beispiel #7
0
        private void EjecutarSP()
        {
            string cc, nombre, fecha, pendiente;

            pendiente = "Pendiente";
            fecha     = DateTime.Today.ToString("dd-MM-yyyy");
            string usu = Session["nom"].ToString();



            // envio el correo del usuario
            DataSetTableAdapters.UsuarioTableAdapter obj = new DataSetTableAdapters.UsuarioTableAdapter();
            string email = obj.UsuarioCorreo(Lblusu.Text).ToString();



            // consulto y envio el correo del gerente x el CC
            DataSetTableAdapters.CD_GERENCIATableAdapter obj3 = new DataSetTableAdapters.CD_GERENCIATableAdapter();
            string correoGer = obj3.UsuarioCorreoGerente(lblcc.Text).ToString();

            // actualizo el estado de la tabla

            DataSetTableAdapters.Solicitud_mTableAdapter obj4 = new DataSetTableAdapters.Solicitud_mTableAdapter();
            obj4.UpdatePendiente(usu);

            MailMessage oMsg = new MailMessage();


            //Desde
            oMsg.From = new MailAddress("*****@*****.**");
            //Parañdigame

            oMsg.To.Add("" + email);
            //Copia
            oMsg.Bcc.Add("" + correoGer);
            oMsg.Bcc.Add("*****@*****.**");
            //Asunto
            oMsg.Subject = "Nueva Solicitud de Materiales";
            //Cuerpo del Mensaje
            oMsg.Body       = "Se ha generado una nueva solicitud de materiales del usuario " + Lblusu.Text + " y su numero de solicitud es el  " + Lblid.Text + "<br /><br/>" + GridViewToHtml(GridView1) + "<br /> Para poder revisar su solicitud, Ingrese <a href=http://10.38.60.4/Materiales/Login.aspx >Aqui</a>.";
            oMsg.IsBodyHtml = true;
            SmtpClient smtp = new SmtpClient("emailsrv.falabella.cl");

            smtp.Port = 25;
            smtp.Send(oMsg);
            oMsg.IsBodyHtml = true;
        }
Beispiel #8
0
        public void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            Session["id1"] = this.GridView1.DataKeys[e.RowIndex].Value.ToString();
            RadioButtonList RadioButtonList1 = (RadioButtonList)this.GridView1.Rows[e.RowIndex].FindControl("RadioButtonList1");
            string          aprobado         = Convert.ToString(RadioButtonList1.SelectedValue);
            int             id = Convert.ToInt32(Session["id1"]);

            if (aprobado == "Para Retirar")
            {
                DataSetTableAdapters.Solicitud_mTableAdapter obj2 = new DataSetTableAdapters.Solicitud_mTableAdapter();
                obj2.UpdateActuaEstadoPara_Retirar(Convert.ToString(id)).ToString();
                Thread t = new Thread(EjecutarSP);
                t.Start();
                Response.Write("<script>alert('Se ha Enviado correctamente el correo');</script>");
                Thread.Sleep(1000);
            }
            else
            {
            }
        }