protected void dN_TextChange(object sender, EventArgs e)
        {
            // ClientScript.RegisterClientScriptBlock(this.GetType(), "Alert", "alert('Selected')", true);

            GridViewRow  gvrow = (GridViewRow)((DropDownList)sender).NamingContainer;
            DropDownList dd    = (DropDownList)gvrow.FindControl("n");
            DropDownList ds    = (DropDownList)gvrow.FindControl("SN");
            Label        al    = (Label)gvrow.FindControl("AL");
            Label        cr    = (Label)gvrow.FindControl("Credit");

            al.Text = "0";
            cr.Text = "0";

            int    temp_flag    = 0;
            int    skip_one     = 0;
            String course_code  = "";
            String Course_title = "";
            String temp         = dd.Text;

            for (int j = 0; j < temp.Length; j++)
            {
                if (temp[j].Equals(':'))
                {
                    temp_flag = 1;
                }
                if (temp_flag == 0)
                {
                    course_code += temp[j];
                }
                else
                {
                    if (skip_one == 1)
                    {
                        Course_title += temp[j];
                    }
                    skip_one = 1;
                }
            }

            ArrayList sn = new DatabaseConnectionManager().Get_Query("SELECT DISTINCT Section_Number  FROM load_table where Course_Code='" + course_code + "' AND uid=''", 2);

            ds.DataSource = sn;

            ds.Text = "Select";
            ds.DataBind();
            //ClientScript.RegisterClientScriptBlock(this.GetType(), "Alert", "alert('"+Course_title+"')", true);
            ScriptManager.RegisterClientScriptBlock(UpdatePanel1, UpdatePanel1.GetType(), "", "Close_add_pop();", true);
        }
        protected void btnImprimirCliente_Click1(object sender, EventArgs e)


        {
            DsAgencias dsa = new DsAgencias();
            IAgencia   ag  = AgenciaFactory.GetAgencia();

            ag.AgenciaID = AgenciaConectadaID;

            dsa = ag.GetAgenciasConsultaDataSet();
            string filtro = "AgenciaID =" + AgenciaConectadaID + "";


            DsAgencias.DatosRow[] drLista = (DsAgencias.DatosRow[])dsa.Datos.Select(filtro);

            DsGuiaFacturaImpresion dsFactura = (DsGuiaFacturaImpresion)Session["DatosGuia"];
            //DsEmisionMasiva.DatosDataTable ds = (DsEmisionMasiva.DatosDataTable)Session["dsEmisionMasiva"];
            string pagina = ObtienePaginaImpresion(drLista[0].TipoImpresionGuiaId);

            if (dsFactura.Datos.Count() > 0)
            {
                string script = "";
                System.Web.HttpBrowserCapabilities browser = Request.Browser;
                string name    = browser.Browser;
                float  version = (float)(browser.MajorVersion + browser.MinorVersion);
                if ((name == "IE" && (version == 8)))
                {
                    // script += "window.showModalDialog('" + pagina + "','Imprimiendo Factura...','Height: 934px;Width: 762px;edge: Raised; center: No; Status:No; help: No; resizable: No;');\n";
                    //   script += "		window.showModalDialog('"+pagina+"','','dialogHeight: 934px;dialogWidth: 762px;edge: Raised; center: No; Status:No; help: No; resizable: No;');";
                    script += "		window.open('"+ pagina + "','','Height: 934px;Width: 762px;edge: Raised; center: No; Status:No; help: No; resizable: No;');";
                    ScriptManager.RegisterClientScriptBlock(this.UpdatePanel1,
                                                            UpdatePanel1.GetType(),
                                                            "scriptOpen",
                                                            script,
                                                            true);
                }
                else
                {
                    // script += "window.open('" + pagina + "','Imprimiendo Factura...','left=400, top=100, height=500, width= 800, status=no, resizable=no, scrollbars=no, toolbar=yes,location= no, menubar=yes')";
                    script += "		window.open('"+ pagina + "','','Height: 934px;Width: 762px;edge: Raised; center: No; Status:No; help: No; resizable: No;');";
                    ScriptManager.RegisterClientScriptBlock(this.UpdatePanel1,
                                                            UpdatePanel1.GetType(),
                                                            "scriptOpen",
                                                            script,
                                                            true);
                }
            }
        }
Exemplo n.º 3
0
    protected void btnDelete_Command(object sender, CommandEventArgs e)
    {
        if (!string.IsNullOrWhiteSpace(e.CommandName))
        {
            System.IO.File.Delete(Server.MapPath("~/images/Researchers/" + e.CommandName));
        }
        Database db = new Database(); string sql = string.Empty;

        sql = "delete from " + tablename + " where id =" + e.CommandArgument;

        if (db.ExecuteNonQuery(sql) >= 1)
        {
            ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "WriteMsg", "<SCRIPT LANGUAGE=\"JavaScript\">alertify.success(\"تم الحذف بنجاح.\")</SCRIPT>", false);
        }
        LoadData();
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (Page.IsPostBack == false)
         {
             gvEvent.PageSize = 10;
             bindDataGrid();
         }
     }
     catch (Exception ex)
     {
         UNOException.UNO_DBErrorLog(ex.Message, ex.StackTrace, "EventBrowser");
     }
     ScriptManager.RegisterClientScriptBlock(UpdatePanel1, UpdatePanel1.GetType(), "Script", "HightlightMyTable();", true);
 }
Exemplo n.º 5
0
    private void cargarIBUsuario()
    {
        string  _ddl  = txtusuario.Text;
        DataSet _cant = _consulta.Com21_consulta_ResportesFechaTrans(txtusuario.Text, "0", int.Parse(idBuscar.Value));

        if (_cant.Tables[0].Rows.Count > 0)
        {
            GvRTransacccion.DataSource = _cant.Tables[0];
            GvRTransacccion.DataBind();
        }
        else
        {
            ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "click", "alert('No exite transacciones para el usuario: " + txtusuario.Text + "');", true);
            txtusuario.Text = string.Empty;
        }
    }
Exemplo n.º 6
0
    private void cargarIBFechas()
    {
        DataSet _cat = _consulta.Com21_consulta_ResportesFechaTrans(txtfechaini.Text, txtfechafi.Text, int.Parse(idBuscar.Value));

        if (_cat.Tables[0].Rows.Count > 0)
        {
            GvRTransacccion.DataSource = _cat.Tables[0];
            GvRTransacccion.DataBind();
        }
        else
        {
            ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "click", "alert('No exite transacciones para el rango de fecha: " + txtfechaini.Text + " - " + txtfechafi.Text + "');", true);
            txtfechafi.Text  = string.Empty;
            txtfechaini.Text = string.Empty;
        }
    }
 protected void Button1_Click(object sender, EventArgs e)
 {
     try
     {
         int agencia = Convert.ToInt32(Session["idagencia"]);
         GridView1.DataSource         = ver.NegraFincliente(TextBox1.Text, agencia);
         GridView1.Columns[4].Visible = false;
         GridView1.DataBind();
     }
     catch (Exception ex)
     {
         string notificacion2;
         notificacion2 = "myFunction2();";
         ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "notificacion2", notificacion2, true);
     }
 }
        protected void modify_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            GridViewRow r   = modify.Rows[e.RowIndex];
            Label       HC  = (Label)r.FindControl("hash_code");
            Label       AL  = (Label)r.FindControl("AL");
            Label       CR  = (Label)r.FindControl("Credit");
            Label       UID = (Label)r.FindControl("M_Uid");

            new DatabaseConnectionManager().Modify_Delete(HC.Text, UID.Text, AL.Text, CR.Text);
            //ClientScript.RegisterClientScriptBlock(this.GetType(), "Alert", "alert('"+HC.Text+"-"+AL.Text+"="+CR.Text+"-"+UID.Text+"')", true);
            new DatabaseConnectionManager().Check_Load_By_Uid(query, PlaceHolder1, this);
            modify.EditIndex = -1;
            modify.DataBind();
            ScriptManager.RegisterClientScriptBlock(UpdatePanel1, UpdatePanel1.GetType(), "", "Close_add_pop();", true);
            //banner_update();
        }
Exemplo n.º 9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         try
         {
             lblFrom.Text        = Request.QueryString["from"].ToString();
             lblTo.Text          = Request.QueryString["to"].ToString();
             lblJourneyDate.Text = Request.QueryString["date"].ToString();
             DataSet ds = new DataSet();
             ds = (DataSet)Session["Service"];
             if (ds.Tables[0].Rows.Count != 0)
             {
                 gvSelectCoach.DataSource = ds.Tables[0];
                 gvSelectCoach.DataBind();
             }
             else
             {
                 pnlNo1.Visible      = true;
                 btnContinue.Visible = false;
             }
             if (Request.QueryString.Count == 5)
             {
                 pnlReturn.Visible         = true;
                 lblReturnFrom.Text        = Request.QueryString["to"].ToString();
                 lblReturnTo.Text          = Request.QueryString["from"].ToString();
                 lblReturnJourneyDate.Text = Request.QueryString["Returndate"].ToString();
                 DataSet dsReturn = new DataSet();
                 dsReturn = (DataSet)Session["ReturnService"];
                 if (dsReturn.Tables[0].Rows.Count != 0)
                 {
                     gvSelectReturnCoach.DataSource = dsReturn.Tables[0];
                     gvSelectReturnCoach.DataBind();
                 }
                 else
                 {
                     pnlNo.Visible       = true;
                     btnContinue.Visible = false;
                 }
             }
         }
         catch (Exception ex)
         {
             ScriptManager.RegisterClientScriptBlock(UpdatePanel1, UpdatePanel1.GetType(), "AnyScriptNameYouLike", "alert('" + ex.Message.ToString() + "');", true);
         }
     }
 }
Exemplo n.º 10
0
    protected void btnContactDelete_Click(object sender, EventArgs e)
    {
        Database    db = new Database();
        HiddenField id;
        AdminInfo   UInfo   = Session["AdminInfo"] as AdminInfo;
        ArrayList   arrlist = new ArrayList();

        int x = 0;

        foreach (ListViewItem rptItem in RepeaterLists.Items)
        {
            CheckBox chk = (CheckBox)rptItem.FindControl("CheckBox1");
            if (chk.Checked)
            {
                id = (HiddenField)RepeaterLists.Items[x].FindControl("id");
                arrlist.Add(id.Value);
            }
            x++;
        }

        string sql = string.Empty;

        sql = "delete from " + tablename + " where id !=" + UInfo.Id + " and id in (";

        if (arrlist.Count > 0)
        {
            for (int i = 0; i < arrlist.Count; i++)
            {
                if (i == 0)
                {
                    sql += arrlist[i].ToString();
                }
                else
                {
                    sql += "," + arrlist[i].ToString();
                }
            }

            sql += ")";
            if (db.ExecuteNonQuery(sql) >= 1)
            {
                ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "WriteMsg", "<SCRIPT LANGUAGE=\"JavaScript\">alertify.success(\"تم الحذف بنجاح.\")</SCRIPT>", false);
            }
            LoadData();
            CheckBox10.Checked = false;
        }
    }
Exemplo n.º 11
0
        protected void ibExcel_Click(object sender, ImageClickEventArgs e)
        {
            var dt = GetOperaciones(Convert.ToInt32(hdnBusqueda.Value));

            if (dt == null)
            {
                FuncionGlobal.alerta_updatepanel("Debe hacer una busqueda anteriormente para exportar.", Page, udp);
                return;
            }
            //creo el informe y obtengo su nombre
            var informe = new MatrizExcelBC().GetReporteHipotecario(Session["usrname"].ToString(), dt);

            //llamo al informe para ser abierto o guardado.
            var strAlerta = "window.open('http://sistema.agpsa.cl/Reportes_Excel/" + informe.Trim() + "');";

            ScriptManager.RegisterStartupScript(this.UpdatePanel1, UpdatePanel1.GetType(), "", strAlerta, true);
        }
Exemplo n.º 12
0
 /// <summary>
 /// 验证提交
 /// </summary>
 /// <returns>true通过,false不通过</returns>
 private bool CheckFormSubmit()
 {
     //空值校验
     if (string.IsNullOrEmpty(this.txtPATROLUSER.Text.Trim()))
     {
         ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "", "巡查人员不能为空!", true);
         this.txtPATROLUSER.Focus();
         return(false);
     }
     //if (string.IsNullOrEmpty(this.txtLog.Text.Trim()))
     //{
     //    ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "", "请填写巡查处理情况!", true);
     //    txtLog.Focus();
     //    return false;
     //}
     return(true);
 }
Exemplo n.º 13
0
 protected void svCliente_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
 {
     try {
         int idmora = Convert.ToInt32(GridView1.DataKeys[e.NewSelectedIndex].Value);
         Label3.Text          = presa.InfoParaEditarMora(idmora).Rows[0][0].ToString();
         TextNombre.Text      = presa.InfoParaEditarMora(idmora).Rows[0][1].ToString();
         TextDescripcion.Text = presa.InfoParaEditarMora(idmora).Rows[0][2].ToString();
         TextInteres.Text     = presa.InfoParaEditarMora(idmora).Rows[0][3].ToString();
         Button1.Visible      = false;
         Button3.Visible      = true;
     }
     catch (Exception ex) {
         string notificacion2;
         notificacion2 = "myFunction2();";
         ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "notificacion2", notificacion2, true);
     }
 }
Exemplo n.º 14
0
    private void enviarcorreo()
    {
        try
        {
            if (email_bien_escrito(txtcorreo.Text.Trim()))
            {
                MailMessage objMail = new MailMessage();
                objMail.IsBodyHtml = false;
                objMail.From       = new MailAddress("*****@*****.**");
                objMail.To.Add("*****@*****.**");
                //objMail.To.Add("[email protected],[email protected],[email protected]");
                objMail.Subject = "Información Contáctenos";
                objMail.Body    = "Los datos del contacto son:\nNombres: " + txtnombres.Text + "\nApellidos: " + txtapellidos.Text + "\nEmail: " + txtcorreo.Text + "\nTeléfono: " + txttelefono.Text + "\nAsunto: " + txtasunto.Text + "\nMensaje: " + txtmensaje.Text + "";

                //envio de correos al administrador
                classCom21Correo clCorreo = new classCom21Correo();
                String           _dominio = Request.Url.Authority;
                if (_dominio == "localhost:2304")
                {
                    clCorreo.EnvioLN(1, objMail);
                }
                else
                {
                    clCorreo.EnvioLN(2, objMail);
                }

                ingresarinbox();
                limpiar();

                pMensajesAlertas.Visible = true;
                DMensaje.Attributes.Add("class", "exito");
                DMensaje.InnerText = "Se ha enviado con exito su información.";
            }
            else
            {
                pMensajesAlertas.Visible = true;
                DMensaje.Attributes.Add("class", "error");
                DMensaje.InnerText = "Por favor digite un correo válido";
            }
        }
        catch (Exception ex)
        {
            ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "click", "alert('Su solicitud no fue enviada.');", true);
        }
    }
Exemplo n.º 15
0
 protected void Button3_Click(object sender, EventArgs e)
 {
     try
     {
         if (CheckBox2.Checked == true)
         {
             string mora  = DropDownList1.SelectedValue.ToString();
             int    mora1 = Convert.ToInt32(mora);
             if (RadioButton1.Checked == true)
             {
                 mod.MOdPlan(Convert.ToInt32(Label3.Text), TextNombre.Text, TextDescripcion.Text, Convert.ToInt32(TextPeriodo.Text), true, false, false, Convert.ToInt32(TextInteres.Text), mora1);
             }
             else
             {
                 mod.MOdPlan(Convert.ToInt32(Label3.Text), TextNombre.Text, TextDescripcion.Text, Convert.ToInt32(TextPeriodo.Text), false, true, false, Convert.ToInt32(TextInteres.Text), mora1);
             }
         }
         else
         {
             if (RadioButton1.Checked == true)
             {
                 mod.MOdPlan(Convert.ToInt32(Label3.Text), TextNombre.Text, TextDescripcion.Text, Convert.ToInt32(TextPeriodo.Text), true, false, false, Convert.ToInt32(TextInteres.Text), Convert.ToInt32(Label1.Text));
                 Bitacora bita = new Bitacora();
                 bita.RegistrarBitacora("Actualizar", "Plan " + TextNombre.Text, Convert.ToInt32(Session["idempleado"]));
             }
             else
             {
                 mod.MOdPlan(Convert.ToInt32(Label3.Text), TextNombre.Text, TextDescripcion.Text, Convert.ToInt32(TextPeriodo.Text), false, true, false, Convert.ToInt32(TextInteres.Text), Convert.ToInt32(Label1.Text));
                 Bitacora bita = new Bitacora();
                 bita.RegistrarBitacora("Actualizar", "Plan " + TextNombre.Text, Convert.ToInt32(Session["idempleado"]));
             }
         }
         GridView1.DataSource         = presta.ListarPlanes();
         GridView1.Columns[0].Visible = false;
         GridView1.DataBind();
         string notificacion1;
         notificacion1 = "myFunction();";
         ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "notificacion1", notificacion1, true);
     }
     catch (Exception ex) {
         string notificacion2;
         notificacion2 = "myFunction2();";
         ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "notificacion2", notificacion2, true);
     }
 }
Exemplo n.º 16
0
    protected void lbvisualizar_Click(object sender, EventArgs e)
    {
        try
        {
            if (fuimagen.HasFile)
            {
                string fileName  = Server.HtmlEncode(fuimagen.FileName);
                string extension = System.IO.Path.GetExtension(fileName);
                double fileSize  = fuimagen.PostedFile.ContentLength;
                if ((extension == ".jpg") | (extension == ".bmp") | (extension == ".BMP") | (extension == ".JPG") | (extension == ".PNG") | (extension == ".png") | (extension == ".GIF") | (extension == ".gif"))
                {
                    if (fileSize <= 1024000)
                    {
                        classRandom sa = new classRandom();
                        savePath  = "";
                        savePath += sa.NextString(6, true, false, true, false);
                        savePath += extension;
                        fuimagen.PostedFile.SaveAs(Server.MapPath("..\\upload\\productos\\") + savePath);

                        String ruta = Server.MapPath("..\\upload\\productos\\" + savePath);
                        System.Drawing.Image objImage = System.Drawing.Image.FromFile(ruta);
                        //this.lbltamaño.Text = "Ancho de la imagen: " + objImage.Width.ToString() + "px, Alto de la imagen: " + objImage.Height.ToString() + "px";
                        int ancho = int.Parse(objImage.Width.ToString());
                        int alto  = int.Parse(objImage.Height.ToString());
                        objImage.Dispose();
                        objImage = null;

                        if ((ancho <= 600) && (alto <= 600))
                        {
                            Image3.ImageUrl = "~/upload/productos/" + savePath;
                        }
                        else
                        {
                            ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "click", "alert('Por favor seleccionar una imagen con el tamaño adecuado');", true);
                        }
                    }
                }
            }
        }
        catch (Exception Ex)
        {
            Console.WriteLine(Ex.Message);
            ScriptManager.RegisterStartupScript(upMantenimiento, upMantenimiento.GetType(), "click", "alert('" + Ex.Message + "');", true);
        }
    }
Exemplo n.º 17
0
        //删除按钮
        protected void Button4_Click(object sender, EventArgs e)
        {
            string command = null;

            if (TextBox1.Text.Trim() != "")
            {
                command  = "delete employee where eid='" + TextBox1.Text + "'";
                command += " AND eid != '" + Session["eid"].ToString() + "'";
                operation(command);
                datashow("select * from employee");
                Cleartxtbox();
            }
            else
            {
                ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "", "alert('操作失败,请输入数据')", true);
                return;
            }
        }
Exemplo n.º 18
0
 protected void LinkButton7_Click(object sender, EventArgs e)
 {
     m_astro = (AstroMod)ViewState["NowChart"];
     SetPara();
     InitialFate();
     if (m_astro.type == PublicValue.AstroType.tuiyun)
     {
         ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "tuiyun", "document.getElementById('" + pnlTuiYun.ClientID + "').click();", true);
     }
     else if (m_astro.type == PublicValue.AstroType.hepan)
     {
         ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "hepan", "document.getElementById('" + pnlHePan.ClientID + "').click();", true);
     }
     else
     {
         ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "jiaozhengqian", "document.getElementById('" + pnlJiaoZheng.ClientID + "').click();", true);
     }
 }
Exemplo n.º 19
0
 protected void login_val(object s, EventArgs e)
 {
     try
     {
         if (new DatabaseConn().check_val(uid.Text, pass.Text) == 1)
         {
             Session["uid"] = uid.Text;
             Response.Redirect("Time_table_manager.aspx");
         }
         else
         {
             ScriptManager.RegisterClientScriptBlock(UpdatePanel1, UpdatePanel1.GetType(), "", "alert('Username/Password is Incorrect!!');", true);
         }
     }catch (Exception ex)
     {
         ScriptManager.RegisterClientScriptBlock(UpdatePanel1, UpdatePanel1.GetType(), "", "alert('" + ex.Message + "');", true);
     }
 }
Exemplo n.º 20
0
    protected void btnContinue_Click(object sender, EventArgs e)
    {
        string strServiceNo       = Convert.ToString(Request.Form["optCategoryID"]);
        string strReturnServiceNo = Convert.ToString(Request.Form["optReturnCategoryID"]);

        if (strServiceNo != null && strReturnServiceNo != null)
        {
            Response.Redirect("~/frmSelectSeat.aspx?sno=" + strServiceNo + "&returnsno=" + strReturnServiceNo + "&date=" + Request.QueryString["date"].ToString() + "&returndate=" + Request.QueryString["Returndate"].ToString() + "&from=" + Request.QueryString["from"].ToString() + "&to=" + Request.QueryString["to"].ToString() + "&seats=" + Request.QueryString["seats"].ToString());
        }
        if (strServiceNo != null)
        {
            Response.Redirect("~/frmSelectSeat.aspx?sno=" + strServiceNo + "&date=" + Request.QueryString["date"].ToString() + "&from=" + Request.QueryString["from"].ToString() + "&to=" + Request.QueryString["to"].ToString() + "&seats=" + Request.QueryString["seats"].ToString());
        }
        else
        {
            ScriptManager.RegisterClientScriptBlock(UpdatePanel1, UpdatePanel1.GetType(), "AnyScriptNameYouLike", "alert('Please select one service');", true);
        }
    }
Exemplo n.º 21
0
        protected void gvQuery_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
        {
            try
            {
                int dataIndex = gvQuery.Rows[e.NewSelectedIndex].DataItemIndex;

                var toolDevice = _ToolDevices[dataIndex];

                string src = string.Format("T009Set.aspx?SecurityRightSID={0}&Equipment={1}&Device={2}&ToolDeviceSID={3}",
                                           ProgramRightSID, toolDevice.EquipmentName, toolDevice.DeviceName, toolDevice.ToolDeviceSID);

                ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "OpenDialog", String.Format("OpenjQueryDialog('{0}',1060,600);", src), true);
            }
            catch (Exception ex)
            {
                HandleError(ex);
            }
        }
Exemplo n.º 22
0
    private void cargarIBPrecio()
    {
        String _inicio = "";
        String _fin    = "";
        int    _ddl    = int.Parse(ddlPrecio.SelectedValue.ToString());

        if (ddlPrecio.SelectedValue == "0")
        {
            _inicio = "0";
            _fin    = "500.00";
        }
        if (ddlPrecio.SelectedValue == "1")
        {
            _inicio = "500.01";
            _fin    = "800.00";
        }
        if (ddlPrecio.SelectedValue == "2")
        {
            _inicio = "800.01";
            _fin    = "1000.00";
        }
        if (ddlPrecio.SelectedValue == "3")
        {
            _inicio = "1000.01";
            _fin    = "1500.00";
        }
        if (ddlPrecio.SelectedValue == "4")
        {
            _inicio = "1500.01";
            _fin    = "1500.01";
        }
        DataSet _cant = _consulta.Com21_consulta_Resportes(3, _ddl, _inicio, _fin);

        if (_cant.Tables[0].Rows.Count > 0)
        {
            GvRProductos.DataSource = _cant.Tables[0];
            GvRProductos.DataBind();
        }
        else
        {
            ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "click", "alert('No exiten registro para el rango de precios: " + ddlPrecio.SelectedItem + "" + "');", true);
        }
    }
        protected void modify_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            GridViewRow  r            = modify.Rows[e.RowIndex];
            Label        HC           = (Label)r.FindControl("hash_code");
            Label        AL           = (Label)r.FindControl("AL");
            Label        CR           = (Label)r.FindControl("Credit");
            Label        UID          = (Label)r.FindControl("M_Uid");
            Label        Name         = (Label)r.FindControl("M_N");
            DropDownList DN           = (DropDownList)r.FindControl("n");
            DropDownList SN           = (DropDownList)r.FindControl("SN");
            int          temp_flag    = 0;
            int          skip_one     = 0;
            String       course_code  = "";
            String       Course_title = "";
            String       temp         = DN.Text;

            for (int j = 0; j < temp.Length; j++)
            {
                if (temp[j].Equals(':'))
                {
                    temp_flag = 1;
                }
                if (temp_flag == 0)
                {
                    course_code += temp[j];
                }
                else
                {
                    if (skip_one == 1)
                    {
                        Course_title += temp[j];
                    }
                    skip_one = 1;
                }
            }
            //ScriptManager.RegisterClientScriptBlock(UpdatePanel1,UpdatePanel1.GetType(), "", "alert('" + Name.Text +"-"+UID.Text+ "')", true);
            new DatabaseConnectionManager().Modify_Update(HC.Text, UID.Text, Name.Text, SN.Text, AL.Text, course_code, Course_title, CR.Text, UpdatePanel1);
            new DatabaseConnectionManager().Check_Load_By_Uid(query, PlaceHolder1, this);
            ScriptManager.RegisterClientScriptBlock(UpdatePanel1, UpdatePanel1.GetType(), "", "Close_add_pop();", true);
            banner_update();
            modify.EditIndex = -1;
            modify.DataBind();
        }
Exemplo n.º 24
0
 protected void btn_ThemTK_Click(object sender, EventArgs e)
 {
     try
     {
         User tblUser = new User();
         tblUser.UserName = txtUser.Text ?? null;
         tblUser.Pass     = txtPass.Text ?? null;
         tblUser.Role     = Request.Form["role"].ToString();
         tblUser.IsLocked = false;
         db.Users.Add(tblUser);
         db.SaveChanges();
         ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "alert", MyHelper.MessagerstrSuccess("Thêm tài khoản đến thành công."), true);
         txtUser.Text = txtPass.Text = "";
         LoadData();
     }
     catch
     {
     }
 }
Exemplo n.º 25
0
        protected void grv_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            int ID = Convert.ToInt32(grv.DataKeys[e.RowIndex].Values[0]);
            Cls_ShopsPayments cls = new Cls_ShopsPayments();

            cls.ID_Payment_find = ID;

            if (cls.doDelete() == 1)
            {
                string sMessages = "alert('Đã xóa thành công');";
                ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "", sMessages, true);
            }
            else
            {
                string sMessages = "alert('Đã xảy ra lỗi trong quá trình xóa dữ liệu');";
                ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "", sMessages, true);
            }
            BindData();
        }
Exemplo n.º 26
0
 protected void btn_themga_Click(object sender, EventArgs e)
 {
     try
     {
         GaDen tblGaDen = new GaDen();
         tblGaDen.MaGa    = txtMaga.Text ?? null;
         tblGaDen.TenGa   = txtTenGa.Text ?? null;
         tblGaDen.Address = txtDiaChi.Text ?? null;
         db.GaDens.Add(tblGaDen);
         db.SaveChanges();
         LoadData();
         //Page.ClientScript.RegisterClientScriptBlock(e.GetType(), "alert", MyHelper.MessagerSuccess("Thêm ga đến thành công."), true);
         ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "alert", MyHelper.MessagerstrSuccess("Thêm ga đến thành công."), true);
         txtTenGa.Text = txtMaga.Text = txtDiaChi.Text = null;
     }
     catch
     {
     }
 }
Exemplo n.º 27
0
 protected void gv_gaden_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     try
     {
         GridViewRow row  = (GridViewRow)gv_gaden.Rows[e.RowIndex];
         int         gaid = Convert.ToInt32(gv_gaden.DataKeys[e.RowIndex].Value.ToString());
         var         item = db.GaDens.Where(x => x.Id == gaid).FirstOrDefault();
         if (item != null)
         {
             db.GaDens.Remove(item);
             db.SaveChanges();
             LoadData();
             ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "alert", MyHelper.MessagerstrSuccess("Xóa dữ liệu thành công."), true);
         }
     }
     catch
     {
     }
 }
Exemplo n.º 28
0
    protected void btnGetFormField_Click(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(txtFormName.Text.Trim()))
        {
            string errorMessage = "";
            using (SqlDataAdapter sda = new SqlDataAdapter(@"
                SELECT TOP 1 VERSION_FIELD 
                  FROM TB_WKF_FORM_VERSION 
                 WHERE FORM_ID = (SELECT FORM_ID 
					                FROM TB_WKF_FORM 
				                   WHERE FORM_NAME = @FORM_NAME)
              ORDER BY [VERSION] DESC
                ", new DatabaseHelper().Command.Connection.ConnectionString))
                using (DataSet ds = new DataSet())
                {
                    sda.SelectCommand.Parameters.AddWithValue("@FORM_NAME", txtFormName.Text.Trim());
                    try
                    {
                        if (sda.Fill(ds) > 0)
                        {
                            txtVERSION_FIELD.Text = ds.Tables[0].Rows[0]["VERSION_FIELD"].ToString();
                        }
                        else
                        {
                            errorMessage = string.Format("表單名稱:「{0}」,找不到", txtFormName.Text.Trim());
                        }
                    }
                    catch (Exception ex)
                    {
                        errorMessage = ex.Message;
                    }
                    if (!string.IsNullOrEmpty(errorMessage))
                    {
                        ScriptManager.RegisterClientScriptBlock(UpdatePanel1,
                                                                UpdatePanel1.GetType(),
                                                                Guid.NewGuid().ToString(),
                                                                string.Format(@"alert('失敗:{0}');", errorMessage),
                                                                true);
                    }
                    lblErrorMsg.Text = errorMessage;
                }
        }
    }
Exemplo n.º 29
0
        protected void btnReImprimirCliente_Click(object sender, EventArgs e)
        {
            string pagina = "";
            string ordens = Convert.ToString(Session["ImprimirOrdenes"]);
            //si son ordenes de tipo r que imprima la solicitud
            DsHojaRutaRepartidor dsoRdenes = new DsHojaRutaRepartidor();
            ISolicitudRetiro     sr        = SolicitudRetiroFactory.GetSolicitudRetiroFactory();

            dsoRdenes = sr.ImprimirOrdenesMasiva(ordens);

            Session["imprimirOrden"] = dsoRdenes;

            pagina = "ImprimirGuiaBlanco.aspx";


            //DsGuiaFacturaImpresion dsFactura = (DsGuiaFacturaImpresion)Session["DatosGuia"];
            //string pagina = ObtienePaginaImpresion(drLista[0].TipoImpresionGuiaId);
            if (dsoRdenes.Ordenes.Count() > 0)
            {
                string script = "";
                System.Web.HttpBrowserCapabilities browser = Request.Browser;
                string name    = browser.Browser;
                float  version = (float)(browser.MajorVersion + browser.MinorVersion);
                if ((name == "IE" && (version == 8)))
                {
                    script += "		window.open('"+ pagina + "','','Height: 934px;Width: 762px;edge: Raised; center: No; Status:No; help: No; resizable: No;');";
                    ScriptManager.RegisterClientScriptBlock(this.UpdatePanel1,
                                                            UpdatePanel1.GetType(),
                                                            "scriptOpen",
                                                            script,
                                                            true);
                }
                else
                {
                    script += "		window.open('"+ pagina + "','','Height: 934px;Width: 762px;edge: Raised; center: No; Status:No; help: No; resizable: No;');";
                    ScriptManager.RegisterClientScriptBlock(this.UpdatePanel1,
                                                            UpdatePanel1.GetType(),
                                                            "scriptOpen",
                                                            script,
                                                            true);
                }
            }
        }
Exemplo n.º 30
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        chartproperty chprop = new chartproperty();

        chprop.chartId     = "myChart1";
        chprop.chartType   = "column3d";
        chprop.chartWidth  = "600";
        chprop.chartHeight = "350";
        chprop.xmlurl      = "Data/maindata.json";
        chprop.renderId    = "Label1";
        List <chartproperty> listofchart = new List <chartproperty>();

        listofchart.Add(chprop);
        foreach (var item in listofchart.Select((x, i) => new { Value = x, Index = i }))
        {
            // calling javacript function passing all chart properties.
            ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "codeMethod" + item.Index + "", "chartMethod('" + item.Value.chartId + "','" + item.Value.chartType + "','" + item.Value.chartWidth + "','" + item.Value.chartHeight + "','" + item.Value.xmlurl + "','" + item.Value.renderId + "');", true);
        }
    }