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; }
protected void Button2_Click(object sender, EventArgs e) { string carrid = DD_carrier.SelectedItem.Value; DespatchDAO desdao = new DespatchDAO(); CageReportsDAO crdao = new CageReportsDAO(); try { string carrbarcode = crdao.GetCarrierBarcode(carrid); decimal cagecount = desdao.ValidateCagesForDespatch(carrbarcode); if (cagecount > 0) { string queueoutput = desdao.QueueForDespatch(carrbarcode, username); } this.BindData_troverview(carrid); RadGrid2.Rebind(); CageReportsDAO cg_firstload = new CageReportsDAO(); string carrierid = DD_carrier.SelectedItem.Value; string cagesids = cg_firstload.Getcageidstring(carrierid); if (cagesids == string.Empty || cagesids == "null" || cagesids == "0") { Label1.Text = string.Empty; } else { Label1.Text = "Cages Despatched for " + carrid; Label1.ForeColor = Color.Blue; } } catch (Exception Ex2) { Label1.Text = "Error:" + Ex2.Message.Substring(Ex2.Message.IndexOf(" ", 0), (Ex2.Message.IndexOf("ORA", 1) - Ex2.Message.IndexOf(" ", 0))); Label1.Visible = true; Label1.ForeColor = Color.Red; } Label1.Visible = true; }