Example #1
0
 protected void grdVisits_RowCommand(object sender, ASPxGridViewRowCommandEventArgs e)
 {
     if (e.CommandArgs.CommandName.ToString().ToLower() == "select")
     {
         int          visibleIndex  = e.VisibleIndex;
         ASPxGridView aSPxGridView  = this.grdVisits;
         string[]     strArrays     = new string[] { "sz_reason" };
         string       str           = aSPxGridView.GetRowValues(visibleIndex, strArrays).ToString();
         ASPxGridView aSPxGridView1 = this.grdVisits;
         string[]     strArrays1    = new string[] { "i_reason_id" };
         string       str1          = aSPxGridView1.GetRowValues(visibleIndex, strArrays1).ToString();
         this.memo_descver.Text = str;
         this.txt_reasonid.Text = str1;
         this.btnadd.Enabled    = false;
         this.btnupdate.Enabled = true;
     }
     if (e.CommandArgs.CommandName.ToString().ToLower() == "delete")
     {
         int          num           = e.VisibleIndex;
         ASPxGridView aSPxGridView2 = this.grdVisits;
         string[]     strArrays2    = new string[] { "sz_reason" };
         aSPxGridView2.GetRowValues(num, strArrays2).ToString();
         ASPxGridView aSPxGridView3 = this.grdVisits;
         string[]     strArrays3    = new string[] { "i_reason_id" };
         string       str2          = aSPxGridView3.GetRowValues(num, strArrays3).ToString();
         ASPxGridView aSPxGridView4 = this.grdVisits;
         string[]     strArrays4    = new string[] { "sz_company_id" };
         string       str3          = aSPxGridView4.GetRowValues(num, strArrays4).ToString();
         this.txt_reasonid.Text  = str2;
         this.txt_companyid.Text = str3;
         this.deleteverification();
     }
 }
 protected void ASPxGridView1_RowCommand(object sender, ASPxGridViewRowCommandEventArgs e)
 {
     Session["IdEvento"] = (sender as ASPxGridView).GetRowValuesByKeyValue(e.KeyValue, "Id").ToString();
     //Ejecutar proceso
     int Identificador = Convert.ToInt32(Session["IdEvento"].ToString());
     //Preguntar por el estado si es abierto entonces crar bitácora
 }
Example #3
0
    //end linq selecting

    //row comand elements
    protected void dxgridordertop_RowCommand(object sender, ASPxGridViewRowCommandEventArgs e)
    {
        try
        {
            Int32 _idx = e.VisibleIndex;
            //string[] _fields = {"qry_text","qry_desc"};
            string _command = e.CommandArgs.CommandArgument.ToString();

            string _id = this.dxgridordertop.GetRowValues(_idx, "OrderNumber").ToString();

            if (!string.IsNullOrEmpty(_id))
            {
                switch (_command)
                {
                case "viewdetails":     //open search page
                {
                    //encryption
                    string _redirect = "../tracking/shipment_tracking.aspx?" + "sq=" + wwi_security.EncryptString("Publiship Reference==" + _id, "publiship");
                    Response.Redirect(_redirect, false);
                    break;
                }

                default:
                {
                    break;
                }
                } //end switch
            }     //end if
        }
        catch (Exception ex)
        {
            this.dxlblerr4.Text    = ex.Message.ToString();
            this.dxlblerr4.Visible = true;
        }
    }
    //end reset hidden


    /// <summary>
    /// row command postbacks
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void dxgrdorders_RowCommand(object sender, ASPxGridViewRowCommandEventArgs e)
    {
        try
        {
            Int32 _idx = e.VisibleIndex;
            //string[] _fields = {"qry_text","qry_desc"};
            string _command = e.CommandArgs.CommandArgument.ToString();

            Int32 _orderid = wwi_func.vint(this.dxgrdTarget.GetRowValues(_idx, "OrderID").ToString());

            if (_orderid > 0)
            {
                switch (_command)
                {
                case "print_labels":     //drop record into pricer
                {
                    string _err = itextsharp_out.advance_labels(_orderid);
                    break;
                }

                default:
                {
                    break;
                }
                } //end switch
            }     //end if
        }
        catch (Exception ex)
        {
            Response.Write(ex.Message.ToString());
        }
    }
Example #5
0
    }//end linq server mode

    /// <summary>
    /// derive filter from selected row and apply to cargo update editor - find by selected order id
    /// rebuild session with selected filter
    /// redirect to orders search page
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void dxgrdquerylog_RowCommand(object sender, ASPxGridViewRowCommandEventArgs e)
    {
        try
        {
            Int32 _idx = e.VisibleIndex;
            //string[] _fields = {"qry_text","qry_desc"};

            string _orderid = this.dxgrdquerylog.GetRowValues(_idx, "orderid").ToString();

            if (!string.IsNullOrEmpty(_orderid))
            {
                SessionParameterPasser _sessionWrapper = new SessionParameterPasser("~/Ord_Edit_Cargo.aspx");
                _sessionWrapper["query"] = "orderid==" + _orderid;
                _sessionWrapper["name"]  = "query_order_id";
                _sessionWrapper["mode"]  = "0";
                _sessionWrapper.PassParameters();
                //force submit of query and set mode to 0 (history)
                //this does not work!
                //Page.ClientScript.RegisterStartupScript(GetType(), "QRY_MOD", "window.submit_query(0);", true);
                //Response.Redirect("~/Default.aspx",false);
            }
        }
        catch (Exception ex)
        {
            Response.Write(ex.Message.ToString());
        }
    }
Example #6
0
        protected void Grid_RowCommand(object sender, ASPxGridViewRowCommandEventArgs e)
        {
            string commandName = e.CommandArgs.CommandName;

            if (commandName.Equals("Nuevo"))
            {
            }
        }
    //end call back

    protected void gridviewPrices1_RowCommand(object sender, ASPxGridViewRowCommandEventArgs e)
    {
        try
        {
            Int32 _idx = e.VisibleIndex;
            //string[] _fields = {"qry_text","qry_desc"};
            string _command = e.CommandArgs.CommandArgument.ToString();

            string _quoteId = this.gridviewPrices1.GetRowValues(_idx, "quote_Id").ToString();

            if (!string.IsNullOrEmpty(_quoteId))
            {
                switch (_command)
                {
                case "editpricer":     //drop record into pricer
                {
                    //encryption
                    string _redirect = "~/pricer/price_quote.aspx?" + "qr=" + wwi_security.EncryptString(_quoteId, "publiship") + "&cv=0";
                    //string _redirect = "Wbs_Pricer_Service.aspx?" + "qr=" + _quoteId.ToString();
                    Response.Redirect(_redirect, false);
                    break;
                }

                case "copypricer":     //drop record into pricer as a new record (client_visisble=true)
                {
                    //encryption
                    string _redirect = "~/pricer/price_quote.aspx?" + "qr=" + wwi_security.EncryptString(_quoteId, "publiship") + "&cv=1";
                    //string _redirect = "Wbs_Pricer_Service.aspx?" + "qr=" + _quoteId.ToString();
                    Response.Redirect(_redirect, false);
                    break;
                }

                case "hidequote":     //flag as clientvisible = 0
                {
                    if (hide_quote(wwi_func.vint(_quoteId)))
                    {
                        this.gridviewPrices1.DataBind();
                    }
                    break;
                }

                default:
                {
                    break;
                }
                } //end switch
            }     //end if
        }
        catch (Exception ex)
        {
            Response.Write(ex.Message.ToString());
        }
    }
    //end linq selecting

    //row comand elements
    protected void dxgridpricertop_RowCommand(object sender, ASPxGridViewRowCommandEventArgs e)
    {
        try
        {
            Int32 _idx = e.VisibleIndex;
            //string[] _fields = {"qry_text","qry_desc"};
            string _command = e.CommandArgs.CommandArgument.ToString();

            string _quoteId = this.dxgridpricertop.GetRowValues(_idx, "quote_Id").ToString();

            if (!string.IsNullOrEmpty(_quoteId))
            {
                switch (_command)
                {
                    case "editpricer": //drop record into pricer to re-calc
                        {
                            //encryption 
                            string _redirect = "../pricer/price_quote.aspx?" + "qr=" + wwi_security.EncryptString(_quoteId, "publiship") + "&cv=0"; 
                            //string _redirect = "Wbs_Pricer_Service.aspx?" + "qr=" + _quoteId.ToString();
                            Response.Redirect(_redirect, false);
                            break;
                        }
                    case "copypricer": //drop record into pricer as a new record (client_visisble=true)
                        {
                            //encryption 
                            string _redirect = "../pricer/price_quote.aspx?" + "qr=" + wwi_security.EncryptString(_quoteId, "publiship") + "&cv=1";
                            //string _redirect = "Wbs_Pricer_Service.aspx?" + "qr=" + _quoteId.ToString();
                            Response.Redirect(_redirect, false);
                            break;
                        }

                    case "hidequote": //flag as clientvisible = 0
                        {
                            //if (hide_quote(wwi_func.vint(_quoteId))) { this.gridviewPrices1.DataBind(); }
                            break;
                        }

                    default:
                        {
                            break;
                        }

                }//end switch

            }//end if
        }
        catch (Exception ex)
        {
            this.dxlblerr6.Text = ex.Message.ToString();
            this.dxlblerr6.Visible = true;
        }
    }
        protected void grd_DSRole_RowCommand(object sender, ASPxGridViewRowCommandEventArgs e)
        {
            LinkButton Link = (LinkButton)e.CommandSource;

            if (Link.CommandName == "cmdRole")
            {
                String[] key    = e.KeyValue.ToString().Split('|');
                Int32    IdRole = Convert.ToInt32(key[0]);
                mtView.SetActiveView(vwQuyen);
                Role role = ctlRole.getRolesByID(IdRole);

                TreeListFunction1.Bindata(role.MenuItemFunctions, IdRole);
            }
        }
        protected void grd_DSUsers_RowCommand(object sender, ASPxGridViewRowCommandEventArgs e)
        {
            ImageButton Link = (ImageButton)e.CommandSource;

            if (Link.CommandName == "cmdKhoa")
            {
                String[] key    = e.KeyValue.ToString().Split('|');
                Int32    IdUser = Convert.ToInt32(key[0]);

                ctlUser.updateUserLock(IdUser);

                Bindata();
            }
        }
Example #11
0
    protected void grdProvider_RowCommand(object sender, ASPxGridViewRowCommandEventArgs e)
    {
        string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url);

        using (Utils utility = new Utils())
        {
            utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
        try
        {
            e.KeyValue.ToString();
            string str  = e.KeyValue.ToString();
            string str2 = this.grdProvider.GetRowValues(e.VisibleIndex, new string[] { "SZ_OFFICE" }).ToString();
            this.lblInsName.Text       = str2;
            this.lblInsName.Visible    = true;
            this.Session["ALL_OFF_ID"] = null;
            this.Session["OFF_ID"]     = str;
            this.txtOfficeID.Text      = "'" + str + "'";
            this.Session["Subflag"]    = null;
            this.txtSubFlag.Text       = "";
            this.BinGrid();
            this.grdCaseCount.XGridBind();
            for (int i = 0; i < this.grdCaseCount.Rows.Count; i++)
            {
                LinkButton button = (LinkButton)this.grdCaseCount.Rows[i].FindControl("lnkcount");
                button.Enabled = true;
            }
            this.btnSelectAll.Visible = true;
            this.btnSelectAll.Text    = "Select All";
            this.Session["SelectAll"] = null;
            this.txtSum.Text          = "";
        }
        catch (Exception ex)
        {
            Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
            using (Utils utility = new Utils())
            {
                utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
            }
            string str2 = "Error Request=" + id + ".Please share with Technical support.";
            base.Response.Redirect("../Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2);
        }
        //Method End
        using (Utils utility = new Utils())
        {
            utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
    }
        protected void ASPxGridView1_RowCommand(object sender, ASPxGridViewRowCommandEventArgs e)
        {
            try
            {
                Session["idCajaChica"] = (sender as ASPxGridView).GetRowValuesByKeyValue(e.KeyValue, "idCajaChica").ToString();
                pcPopup.ContentUrl = "../Reportes/FrmReciboCajaChica.aspx";
                pcPopup.ShowOnPageLoad = true;

            }
            catch (Exception ex)
            {

                this.lblMensaje.Text = Utilidades.validarExepcionSQL(ex.Message);
                this.lblMensaje.CssClass = "errorMessage";
                Session["errorMessage"] = ex.Message;
            }
        }
    protected void gv_RowCommand(object sender, ASPxGridViewRowCommandEventArgs e)
    {
        string cmd = e.CommandArgs.CommandName;
        if (cmd == "Delete")
        {
            DataTable dt = getCurrentGridData(gv);
            dt.Rows.RemoveAt(e.VisibleIndex);
            for (int i = 0; i <= dt.Rows.Count - 1; i++)
            {
                string seq = (i + 1).ToString() + ".";

                dt.Rows[i]["Seq"] = seq;
            }
            gv.DataSource = dt;
            gv.DataBind();
        }
    }
    }//end linq server mode

    /// <summary>
    /// derive filter from selected row and apply to orders view
    /// rebuild session with selected filter
    /// redirect to orders search page
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void dxgrdquerylog_RowCommand(object sender, ASPxGridViewRowCommandEventArgs e)
    {
        try
        {
            Int32 _idx = e.VisibleIndex;
            //string[] _fields = {"qry_text","qry_desc"};

            string _fex     = this.dxgrdquerylog.GetRowValues(_idx, "qry_text").ToString();
            string _fname   = this.dxgrdquerylog.GetRowValues(_idx, "qry_desc").ToString();
            string _fsource = this.dxgrdquerylog.GetRowValues(_idx, "qry_source").ToString();
            string _default = "shipment";//default to shipment tracking
            string _url     = "../tracking/{0}_tracking.aspx";

            _url = _fsource != "" ? string.Format(_url, _fsource): string.Format(_url, _default);
            //old code we are using form names instead of codes in qry_source as of 20/03/15
            //if (_fsource == "CNTR") {
            //    _url = "../tracking/container_tracking.aspx";
            //}
            //else if(_fsource == "DLVRY"){
            //     _url = "../tracking/delivery_tracking.aspx";
            //}
            //else if(_fsource == "NSHIP"){
            //     _url =  "../tracking/not_shipped_tracking.aspx";
            //}

            if (!string.IsNullOrEmpty(_fex))
            {
                SessionParameterPasser _sessionWrapper = new SessionParameterPasser(_url);
                _sessionWrapper["query"]  = _fex;
                _sessionWrapper["name"]   = _fname;
                _sessionWrapper["mode"]   = "0";
                _sessionWrapper["source"] = _fsource;
                _sessionWrapper.PassParameters();
                //force submit of query and set mode to 0 (history)
                //this does not work!
                //Page.ClientScript.RegisterStartupScript(GetType(), "QRY_MOD", "window.submit_query(0);", true);
                //Response.Redirect("~/Default.aspx",false);
            }
        }
        catch (Exception ex)
        {
            Response.Write(ex.Message.ToString());
        }
    }
    protected void ASPxGridView1_RowCommand(object sender, ASPxGridViewRowCommandEventArgs e)
    {
        //if (e.CommandArgs.CommandName=="Update")
            //{
         up = (UploadFileUserControl)ASPxGridView1.FindEditRowCellTemplateControl((GridViewDataColumn)ASPxGridView1.Columns["IMG"], "UploadFileUserControl1");
            ASPxTextBox txImage = (ASPxTextBox)ASPxGridView1.FindEditRowCellTemplateControl((GridViewDataColumn)ASPxGridView1.Columns["IMG"], "filePathTextBox");

            //if (txImage.Text == "")
            //    txImage.Text = ViewState["path"].ToString();

            up.PathID = 1;
            up.GetFileNameEvent += up_GetFileNameEvent;
            up.PathName = txImage.Text;

            up.MFileSize = 100000;
            up.FireEvent();

           // }
    }
Example #16
0
    protected void grdModifier_RowCommand(object sender, ASPxGridViewRowCommandEventArgs e)
    {
        string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url);

        using (Utils utility = new Utils())
        {
            utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
        try
        {
            if (e.CommandArgs.CommandName == "select")
            {
                ASPxGridView grid = (ASPxGridView)sender;
                object       id_  = e.KeyValue;
                txtModifier.Text           = grid.GetRowValuesByKeyValue(id_, "sz_modifier").ToString();
                txtIDCode.Text             = grid.GetRowValuesByKeyValue(id_, "sz_code").ToString();
                txtModifierDesc.Text       = grid.GetRowValuesByKeyValue(id_, "sz_modifier_desc").ToString();
                txtSelectedModifierID.Text = grid.GetRowValuesByKeyValue(id_, "i_modifier_id").ToString();
                btnAdd.Enabled             = false;
                btnUpdate.Enabled          = true;
            }
        }
        catch (Exception ex)
        {
            Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
            using (Utils utility = new Utils())
            {
                utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
            }
            string str2 = "Error Request=" + id + ".Please share with Technical support.";
            base.Response.Redirect("../Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2);
        }

        //Method End
        using (Utils utility = new Utils())
        {
            utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
    }
        protected void gvUsariosPlataforma_RowCommand(object sender, ASPxGridViewRowCommandEventArgs e)
        {
            try
            {
                string sOpcion = ((DevExpress.Web.ASPxButton)e.CommandSource).CommandName.S();
                iIdUsuarioPlat = e.CommandArgs.CommandArgument.S().I();

                if (sOpcion == "Actualizar")
                {
                    object cellValues = gvUsuariosPlataforma.GetRowValuesByKeyValue(iIdUsuarioPlat, new string[] { "Correo"           //0
                                                                                                                   , "NombreCompleto" //1
                                                                                                                   , "Telefono"       //2
                                                                                                                   , "Password"       //3
                                                                                    });

                    UsuariosPlataforma oU = new UsuariosPlataforma();
                    oU.sCorreo   = ((object[])cellValues)[0].S();
                    oU.sNombre   = ((object[])cellValues)[1].S();
                    oU.sTelefono = ((object[])cellValues)[2].S();
                    oU.sPassword = ((object[])cellValues)[3].S();

                    oUser = oU;

                    ppAltaUsuario.ShowOnPageLoad = true;
                }
                else if (sOpcion == "Eliminar")
                {
                    if (eDeleteObj != null)
                    {
                        eDeleteObj(sender, e);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 protected void viewODS_SYSTEM_ROLE_ListView_RowCommand(object sender, ASPxGridViewRowCommandEventArgs e)
 {
 }
 /// <summary>
 /// envia el correo seleccionado
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void ASPxGridView1_RowCommand(object sender, ASPxGridViewRowCommandEventArgs e)
 {
     this.enviarCorreo(e.VisibleIndex);
 }
    //end linq selecting

    //row comand elements
    protected void dxgridordertop_RowCommand(object sender, ASPxGridViewRowCommandEventArgs e)
    {
        try
        {
            Int32 _idx = e.VisibleIndex;
            //string[] _fields = {"qry_text","qry_desc"};
            string _command = e.CommandArgs.CommandArgument.ToString();

            string _id = this.dxgridordertop.GetRowValues(_idx, "OrderNumber").ToString();

            if (!string.IsNullOrEmpty(_id))
            {
                switch (_command)
                {
                    case "viewdetails": //open search page
                        {
                            //encryption 
                            string _redirect = "../tracking/shipment_tracking.aspx?" + "sq=" + wwi_security.EncryptString("Publiship Reference==" + _id, "publiship");
                            Response.Redirect(_redirect, false);
                            break;
                        }
                    default:
                        {
                            break;
                        }

                }//end switch

            }//end if
        }
        catch (Exception ex)
        {
            this.dxlblerr4.Text = ex.Message.ToString();
            this.dxlblerr4.Visible = true;
        }
    }
 protected void gv_RowCommand(object sender, ASPxGridViewRowCommandEventArgs e)
 {
 }
    /// <summary>
    /// 21.10.14 Paul Edwards these buttons not available for deliveries hide link to documents if no document folder linked to order
    /// row commands (and custombuttoncallbacks) get seriously messed up when we set_visible_data() in page_load 
    /// unless set_visible_data() is wrapped in a !page.IspostBack statement row command event does not fire
    /// but if we wrap set_visible_data() the preferred columns are not retained between postbacks unless Grid.EnabelViewState=true
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void gridOrder_RowCommand(object sender, ASPxGridViewRowCommandEventArgs e)
    {
        try
        {
            Int32 _idx = e.VisibleIndex;
            //string[] _fields = {"qry_text","qry_desc"};
            string _command = e.CommandArgs.CommandArgument.ToString();

            string _orderno = this.gridContainer.GetRowValues(_idx, "OrderNumber") != null ? this.gridContainer.GetRowValues(_idx, "OrderNumber").ToString() : "";
            //100112 check to see if this order is attached to a document folder other than it's own ordernumber
            string _docfolder = this.gridContainer.GetRowValues(_idx, "document_folder") != null ? this.gridContainer.GetRowValues(_idx, "document_folder").ToString() : "";
            //160112 pass house BL as we can use this to ientify which orders are grouped together 
            string _housebl = this.gridContainer.GetRowValues(_idx, "HouseBLNUmber") != null ? this.gridContainer.GetRowValues(_idx, "HouseBLNUmber").ToString() : "";

            if (!string.IsNullOrEmpty(_orderno))
            {
                switch (_command)
                {
                    case "link_filemanager":
                        {
                            //internal use only!
                            Session["orderlist"] = null;
                            string _redirect = "~/tracking/file_manager.aspx?" + "pod=" + wwi_security.EncryptString(_orderno, "publiship") + "&dfd=" + wwi_security.EncryptString(_docfolder, "publiship") + "&hbl=" + wwi_security.EncryptString(_housebl, "publiship");

                            //string _redirect = "Wbs_Pricer_Service.aspx?" + "qr=" + _quoteId.ToString();
                            Response.Redirect(_redirect, false);
                            break;
                        }

                    default:
                        {
                            break;
                        }
                }//end switch

            }//end if
        }
        catch (Exception ex)
        {
            Response.Write(ex.Message.ToString());
        }
    }
    }//end linq server mode

    /// <summary>
    /// derive filter from selected row and apply to orders view
    /// rebuild session with selected filter
    /// redirect to orders search page
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void dxgrdquerylog_RowCommand(object sender, ASPxGridViewRowCommandEventArgs e)
    {
        try
        {
            Int32 _idx = e.VisibleIndex;
            //string[] _fields = {"qry_text","qry_desc"};

            string _fex = this.dxgrdquerylog.GetRowValues(_idx, "qry_text").ToString();
            string _fname = this.dxgrdquerylog.GetRowValues(_idx, "qry_desc").ToString();
            string _fsource = this.dxgrdquerylog.GetRowValues(_idx, "qry_source").ToString();
            string _default = "shipment";//default to shipment tracking
            string _url = "../tracking/{0}_tracking.aspx";

            _url = _fsource != "" ? string.Format(_url, _fsource): string.Format(_url, _default);    
            //old code we are using form names instead of codes in qry_source as of 20/03/15 
            //if (_fsource == "CNTR") { 
            //    _url = "../tracking/container_tracking.aspx";
            //}
            //else if(_fsource == "DLVRY"){
            //     _url = "../tracking/delivery_tracking.aspx";
            //}
            //else if(_fsource == "NSHIP"){
            //     _url =  "../tracking/not_shipped_tracking.aspx";
            //}
           
            if (!string.IsNullOrEmpty(_fex))
            {
                SessionParameterPasser _sessionWrapper = new SessionParameterPasser(_url);
                _sessionWrapper["query"] = _fex;
                _sessionWrapper["name"] = _fname;
                _sessionWrapper["mode"] = "0";
                _sessionWrapper["source"] = _fsource;
                _sessionWrapper.PassParameters();
                //force submit of query and set mode to 0 (history)
                //this does not work!
                //Page.ClientScript.RegisterStartupScript(GetType(), "QRY_MOD", "window.submit_query(0);", true);
                //Response.Redirect("~/Default.aspx",false); 
            }
        }
        catch(Exception ex)
        {
            Response.Write(ex.Message.ToString());  
        }
    }
    //end reset hidden


    /// <summary>
    /// row command postbacks
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void dxgrdorders_RowCommand(object sender, ASPxGridViewRowCommandEventArgs e)
    {

        try
        {
            Int32 _idx = e.VisibleIndex;
            //string[] _fields = {"qry_text","qry_desc"};
            string _command = e.CommandArgs.CommandArgument.ToString();

            Int32 _orderid = wwi_func.vint(this.dxgrdorders.GetRowValues(_idx, "OrderID").ToString());

            if (_orderid > 0)
            {
                switch(_command){
                    case "print_labels": //drop record into pricer
                        {
                            string _err = itextsharp_out.advance_labels(_orderid);
                            break;
                        }
                    default:
                        {
                            break;
                        }
                }//end switch
                
            }//end if
        }
        catch (Exception ex)
        {
            Response.Write(ex.Message.ToString());
        }
    }
 protected void ASPxGridView1_RowCommand(object sender, ASPxGridViewRowCommandEventArgs e)
 {
     try
     {
         Session["barcode"] = (sender as ASPxGridView).GetRowValuesByKeyValue(e.KeyValue, "idInventario").ToString();
         pcPopup.ContentUrl = "../Barcode/FrmBarCode.aspx";
         pcPopup.ShowOnPageLoad = true;
     }
     catch (Exception ex)
     {
          Session["ErrorGenerado"]=ex.ToString();
     }
 }
    }//end linq server mode

    /// <summary>
    /// derive filter from selected row and apply to cargo update editor - find by selected order id
    /// rebuild session with selected filter
    /// redirect to orders search page
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void dxgrdquerylog_RowCommand(object sender, ASPxGridViewRowCommandEventArgs e)
    {
        try
        {
            Int32 _idx = e.VisibleIndex;
            //string[] _fields = {"qry_text","qry_desc"};

            string _orderid = this.dxgrdquerylog.GetRowValues(_idx, "orderid").ToString();

            if (!string.IsNullOrEmpty(_orderid))
            {
                SessionParameterPasser _sessionWrapper = new SessionParameterPasser("~/Ord_Edit_Cargo.aspx");
                _sessionWrapper["query"] = "orderid==" + _orderid;
                _sessionWrapper["name"] = "query_order_id";
                _sessionWrapper["mode"] = "0";
                _sessionWrapper.PassParameters();
                //force submit of query and set mode to 0 (history)
                //this does not work!
                //Page.ClientScript.RegisterStartupScript(GetType(), "QRY_MOD", "window.submit_query(0);", true);
                //Response.Redirect("~/Default.aspx",false); 
            }
        }
        catch(Exception ex)
        {
            Response.Write(ex.Message.ToString());  
        }
    }
    //end call back

    protected void gridviewPrices1_RowCommand(object sender, ASPxGridViewRowCommandEventArgs e)
    {

        try
        {
            Int32 _idx = e.VisibleIndex;
            //string[] _fields = {"qry_text","qry_desc"};
            string _command = e.CommandArgs.CommandArgument.ToString();
 
            string _quoteId = this.gridviewPrices1.GetRowValues(_idx, "quote_Id").ToString();

            if (!string.IsNullOrEmpty(_quoteId))
            {
                switch(_command){
                    case "editpricer": //drop record into pricer
                        {
                            //encryption 
                            string _redirect = "~/pricer/price_quote.aspx?" + "qr=" + wwi_security.EncryptString(_quoteId, "publiship");
                            //string _redirect = "Wbs_Pricer_Service.aspx?" + "qr=" + _quoteId.ToString();
                            Response.Redirect(_redirect, false); 
                            break;
                        }
                    case "removepod": //break link to order if there is one
                        {
                            if (remove_pod(wwi_func.vint(_quoteId))) { this.gridviewPrices1.DataBind(); } 
                            break;
                        }
                    default:
                        {
                            break;
                        }
                }//end switch
                
            }//end if
        }
        catch (Exception ex)
        {
            Response.Write(ex.Message.ToString());
        }
    }
 protected void gvSection4_RowCommand(object sender, ASPxGridViewRowCommandEventArgs e)
 {
     string cmd = e.CommandArgs.CommandName;
     if (cmd == "Delete")
     {
         DataTable dt = getCurrentGridDataDDL(gvSection4);
         dt.Rows.RemoveAt(e.VisibleIndex);
         for (int i = 0; i <= dt.Rows.Count - 1; i++)
         {
             dt.Rows[i]["Seq"] = i + 1;
         }
         gvSection4.DataSource = dt;
         gvSection4.DataBind();
     }
 }
Example #29
0
 protected void UsersGridView_RowCommand(object sender, ASPxGridViewRowCommandEventArgs e)
 {
     int index = e.VisibleIndex;
     int ID    = Convert.ToInt32(UsersGridView.KeyFieldName);
 }
        /// <summary>
        /// Agrega un curso a la matricula seleccionada a partir de la oferta academica seleccionada
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void ASPxGridViewOfertaAcademica_RowCommand(object sender, ASPxGridViewRowCommandEventArgs e)
        {
            try
            {
                String curso = (sender as ASPxGridView).GetRowValuesByKeyValue(e.KeyValue, "cursoNombre").ToString();
                Int32 matriculados = Int32.Parse((sender as ASPxGridView).GetRowValuesByKeyValue(e.KeyValue, "matriculados").ToString());
                Int32 cupo = Int32.Parse((sender as ASPxGridView).GetRowValuesByKeyValue(e.KeyValue, "cupo").ToString());

                if (matriculados < cupo)
                {
                    Int32 idMatricula = Int32.Parse(Session["idMatricula"].ToString());
                    Class.Matricula.Matricula matricula = this.matriculaBo.consultarId(new Class.Matricula.Matricula(idMatricula));
                    if ("PENDIENTE".ToString().Equals(matricula.estado))
                    {
                        this.lblMensaje.Text = "Solo se puede agregar cursos a matrículas en PROCESO.";
                        this.lblMensaje.CssClass = "errorMessage";
                        return;
                    }

                    MatriculaDetalle dato = new MatriculaDetalle();
                    dato.ofertaAcademica.idOfertaAcademica = Int32.Parse((sender as ASPxGridView).GetRowValuesByKeyValue(e.KeyValue, "idOfertaAcademica").ToString());
                    dato.matricula.idMatricula = idMatricula;

                    OfertaAcademica oferta = ofertaAcademicaBo.consultarId(dato.ofertaAcademica);
                    dato.producto = oferta.curso.idCurso;
                    dato.costo = oferta.curso.costo;

                    dato.estado = "MATRICULADO";
                    dato.estudiante.idEstudiante = Int32.Parse(this.cmbEstudiante.Value.ToString());
                    dato.usuarioCreacion = Session["usuario"].ToString();

                    dato.esConvalidacion = Confirmacion.NO.ToString();
                    dato.esPruebaGrado = Confirmacion.NO.ToString();

                    if (0 == Int32.Parse((sender as ASPxGridView).GetRowValuesByKeyValue(e.KeyValue, "requistos_pendintes").ToString()))
                    {
                        dato.omiteRequisitos = Confirmacion.NO.ToString();
                    }
                    else
                    {
                        dato.omiteRequisitos = Confirmacion.SI.ToString();
                    }

                    this.matriculaDetalleBo.nuevo(dato);
                    this.lblMensaje.Text = String.Format("Curso: {0}, matrículado.", curso);
                    this.lblMensaje.CssClass = "successMessage";
                }
                else
                {
                    this.lblMensaje.Text = String.Format("Curso: {0}, sin cupo disponible.", curso);
                    this.lblMensaje.CssClass = "errorMessage";
                }

            }
            catch (Exception ex)
            {
                this.lblMensaje.Text = Utilidades.validarExepcionSQL(ex.Message);
                this.lblMensaje.CssClass = "errorMessage";
                Session["errorMessage"] = ex.Message;
            }
            finally
            {
                this.cargarDatos();
            }
        }