Example #1
0
        void gvBatches_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                int preInvoiceBatchID = int.Parse(gvBatches.MasterTableView.DataKeyValues[e.Item.ItemIndex][_preInvoiceBatchID].ToString());

                switch (e.CommandName.ToLower())
                {
                case "continuegroup":
                    HiddenField  hidInvoiceType = (HiddenField)e.Item.FindControl("hidInvoiceType");
                    eInvoiceType invoiceType    = (eInvoiceType)int.Parse(hidInvoiceType.Value);
                    if (invoiceType == eInvoiceType.ClientInvoicing)
                    {
                        Response.Redirect(string.Format("../groupage/autorunconfirmation.aspx?bid={0}", preInvoiceBatchID));
                    }
                    else if (invoiceType == eInvoiceType.SubContractorSelfBill)
                    {
                        Response.Redirect(string.Format("../subcontractorsb/autorunconfirmation.aspx?bid={0}", preInvoiceBatchID));
                    }
                    break;

                case "removegroup":
                    Facade.IPreInvoice facPreInvoice = new Facade.PreInvoice();
                    facPreInvoice.DeleteBatch(preInvoiceBatchID);
                    gvBatches.Rebind();
                    break;
                }
            }
        }