protected void Button3_Click(object sender, EventArgs e) { string carr_id = DD_carrier.SelectedItem.Value; try { // get carrier barcode CageReportsDAO crdao = new CageReportsDAO(); string carrbarcode = crdao.GetCarrierBarcode(carr_id); // get cage barcode Button btn = (Button)sender; GridDataItem dataitem = (GridDataItem)btn.NamingContainer; String scageid = dataitem.GetDataKeyValue("cage_id").ToString(); Int32 icageid = Int32.Parse(scageid); string cagebarcode = crdao.GetCageBarcode(icageid); // call ready to despatch DespatchDAO desdao = new DespatchDAO(); string cagename = desdao.ProcessBarcode(carrbarcode, cagebarcode, username); Label1.Text = "Cage " + scageid + " Is Ready For despatch"; Label1.ForeColor = Color.Blue; Label1.Visible = true; } catch (Exception ex) { Label1.Text = "Error:" + ex.Message.Substring(ex.Message.IndexOf(" ", 0), (ex.Message.IndexOf("ORA", 1) - ex.Message.IndexOf(" ", 0))); Label1.Visible = true; Label1.ForeColor = Color.Red; } //RadGrid2.Rebind(); this.BindData_troverview(carr_id); RadGrid2.Rebind(); GetCageIds(); HiddenField1.Value = cages; }
private void FirstBarcodeCheck() { try { decimal?cageID = null; output = _despatchDao.ProcessBarcode(carrierBarcode, _barcode, User.Identity.Name); ViewState["Output"] = output; if (output.CompareTo(((int)DespatchBarcode.DespatchCages).ToString()) == 0) { cageID = _despatchDao.ValidateCagesForDespatch(carrierBarcode); } DisplayMessageForAction(output, cageID); } catch (Exception exception) { int indx = exception.Message.IndexOf(":"); this.Master.ErrorMessage = exception.Message.Substring((indx + 1), exception.Message.IndexOf("ORA", (indx + 1)) - (indx + 1)); this.Master.DisplayMessage = true; } }