Exemplo n.º 1
0
 private void btnDispatch_Click(object sender, EventArgs e)
 {
     try
     {
         int iValue = 0;
         if (int.TryParse(Convert.ToString(ObjStockDispatch.STOCKDISPATCHID), out iValue) && iValue > 0)
         {
             if (!dxValidationProvider1.Validate())
             {
                 return;
             }
             ObjStockRep.UpdateDispatch(ObjStockDispatch);
             DataSet     ds  = ObjStockRep.GetDispatch(ObjStockDispatch.STOCKDISPATCHID);
             rptDispatch rpt = new rptDispatch(ds.Tables[0], ds.Tables[1]);
             rpt.ShowPrintMarginsWarning = false;
             rpt.ShowRibbonPreview();
             cmbFromBranch.EditValue          = null;
             cmbToBranch.EditValue            = null;
             txtTrayNumber.EditValue          = null;
             cmbFromBranch.Enabled            = true;
             cmbToBranch.Enabled              = true;
             ObjStockDispatch.STOCKDISPATCHID = 0;
             ObjStockDispatch.dtDispatch      = new DataTable();
             gcDispatch.DataSource            = ObjStockDispatch.dtDispatch;
             cmbFromBranch.Focus();
         }
     }
     catch (Exception ex)
     {
         ErrorMgmt.ShowError(ex);
         ErrorMgmt.Errorlog.Error(ex);
     }
 }
 private void btnView_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
 {
     try
     {
         if (gvDispatch.FocusedRowHandle >= 0)
         {
             DataSet ds = ObjStockRep.GetDispatch(gvDispatch.GetFocusedRowCellValue("STOCKDISPATCHID"));
             if (ds != null && ds.Tables.Count > 1)
             {
                 rptDispatch rpt = new rptDispatch(ds.Tables[0], ds.Tables[1]);
                 rpt.ShowPrintMarginsWarning = false;
                 rpt.ShowRibbonPreview();
             }
         }
     }
     catch (Exception ex)
     {
         ErrorMgmt.ShowError(ex);
         ErrorMgmt.Errorlog.Error(ex);
     }
 }