Example #1
0
 private void btnEvalSheet_Click(object sender, EventArgs e)
 {
     if (WorkOrderGrid.GetFocusedRow() is WorkOrders item)
     {
         frmTechnicalEvalSheet frmTechnicalEvalSheet = new frmTechnicalEvalSheet()
         {
             WorkOrderId = item.Id
         };
         frmTechnicalEvalSheet.ShowDialog();
     }
 }
Example #2
0
 private void btnScan_Click(object sender, EventArgs e)
 {
     if (WorkOrderGrid.GetFocusedRow() is WorkOrders item)
     {
         frmScanner frmScanPO = new frmScanner(scanner =>
         {
             scanner.RefId     = item.Id;
             scanner.TableName = "WorkOrders";
         });
     }
 }
Example #3
0
 private void btnEditPo_Click(object sender, EventArgs e)
 {
     if (!User.UserInAction("Edit Work Order"))
     {
         return;
     }
     if (WorkOrderGrid.GetFocusedRow() is WorkOrders item)
     {
         frmAddEditWorkOrder frm = new frmAddEditWorkOrder(item, MethodType.Edit);
         frm.ShowDialog();
     }
 }
Example #4
0
 private void btnAction_Click(object sender, EventArgs e)
 {
     if (!User.UserInAction("Work Order Action"))
     {
         return;
     }
     if (WorkOrderGrid.GetFocusedRow() is WorkOrders item)
     {
         frmDocActions frm = new frmDocActions(tableName: "WorkOrders", refId: item.Id,
                                               label: item?.Employees?.EmployeeName + " - " + item?.PPEs?.EquipmentTypes?.EquipmentType);
         frm.ShowDialog();
         Details(item);
     }
 }
Example #5
0
        private void btnScan_Click(object sender, EventArgs e)
        {
            if (!User.UserInAction("Work Order Scan Document"))
            {
                return;
            }
            frmScanner frmScanPO = new frmScanner(scanner =>
            {
                scanner.RefId     = Convert.ToInt32((WorkOrderGrid.GetFocusedRow() as WorkOrders)?.Id);
                scanner.TableName = "WorkOrders";
            });

            var res = frmScanPO.ShowDialogResult();
        }
Example #6
0
 private void WorkOrderGrid_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
 {
     try
     {
         this.rowHandle = e.FocusedRowHandle;
         if (WorkOrderGrid.GetFocusedRow() is WorkOrders item)
         {
             Details(item);
         }
     }
     catch (Exception exception)
     {
         MessageBox.Show(exception.Message, exception.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Example #7
0
 private void btnTS_Click(object sender, EventArgs e)
 {
     if (WorkOrderGrid.GetFocusedRow() is WorkOrders workOrders)
     {
         if (Application.OpenForms["FrmMain"] is FrmMain frmMain)
         {
             frmMain.pnlDashoard.Controls.Clear();
             var ts = new frmTechSpecs()
             {
                 Dock = DockStyle.Fill
             };
             frmMain.pnlDashoard.Controls.Add(ts);
             ts.NewTS(workOrders);
         }
     }
 }
Example #8
0
 private void btnPrintTR_Click(object sender, EventArgs e)
 {
     if (WorkOrderGrid.GetFocusedRow() is WorkOrders item)
     {
         item.PrintedBy = User.GetUserName();
         Rpt.rptTechnicalReport rpt = new Rpt.rptTechnicalReport()
         {
             DataSource = new List <WorkOrders>()
             {
                 item
             }
         };
         rpt.CreateDocument();
         Rpt.frmReportViewer frm = new Rpt.frmReportViewer(rpt);
         frm.ShowDialog();
     }
 }
Example #9
0
        /*
         * if (UcTechSpecGrid.GridView.GetFocusedRow() is TechSpecs item)
         *  {
         *      this.oldData = item;
         *      this.oldSelectedRow = UcTechSpecGrid.GridView.FocusedRowHandle;
         *      frmAddEditTechSpecs frm = new frmAddEditTechSpecs()
         *      {
         *          frmTechSpecs = this,
         *          TechSpecsId = Convert.ToInt32((UcTechSpecGrid.GridView.GetFocusedRow() as TechSpecs)?.Id),
         *          MethodType = MethodType.Edit
         *      };
         *      frm.ShowDialog();
         *      UcTechSpecGrid.CreateUcControl();
         *
         *      TechSpecDetails.Details(item);
         *      lblPODescription.Text = item.TechSpecsId;
         *      ucTSEquipmentProfiles1.Details(item.Id, "TechSpecs");
         *      UcTechSpecGrid.GridView.SelectRow(this.oldSelectedRow);
         *      UcTechSpecGrid.GridView.FocusedRowHandle = this.oldSelectedRow;
         *      UcTechSpecGrid.GridView.MakeRowVisible(oldSelectedRow);
         *  }
         *
         */
        private void btnEditPo_Click(object sender, EventArgs e)
        {
            if (!User.UserInAction("Edit Work Order"))
            {
                return;
            }
            if (WorkOrderGrid.GetFocusedRow() is WorkOrders item)
            {
                this.rowHandle = WorkOrderGrid.FocusedRowHandle;
                frmAddEditWorkOrder frm = new frmAddEditWorkOrder(item, MethodType.Edit);
                frm.ShowDialog();

                Details(item);
                Init();
                WorkOrderGrid.FocusedRowHandle = rowHandle;
                WorkOrderGrid.SelectRow(rowHandle);
                WorkOrderGrid.MakeRowVisible(rowHandle);
            }
        }
Example #10
0
 private void btnPrint_Click(object sender, EventArgs e)
 {
     if (WorkOrderGrid.GetFocusedRow() is WorkOrders item)
     {
         DocumentLedgerViewModel vm = new DocumentLedgerViewModel();
         vm.WorkOrders = item;
         vm.DocActions = vm.GetDocActions(item.Id);
         vm.PrintedBy  = User.GetUserName();
         Rpt.rptDocumentLedger rpt = new Rpt.rptDocumentLedger()
         {
             DataSource = new List <DocumentLedgerViewModel>()
             {
                 vm
             }
         };
         rpt.CreateDocument();
         Rpt.frmReportViewer frm = new Rpt.frmReportViewer(rpt);
         frm.ShowDialog();
     }
 }
Example #11
0
 private void btnDelete_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
 {
     if (WorkOrderGrid.GetFocusedRow() is WorkOrders item)
     {
         try
         {
             if (MessageBox.Show("Do you want to delete this?", "Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
             {
                 return;
             }
             UnitOfWork unitOfWork = new UnitOfWork();
             unitOfWork.WorkOrdersRepo.Delete(x => x.Id == item.Id);
             unitOfWork.Save();
             Init();
         }
         catch (Exception exception)
         {
             MessageBox.Show(exception.Message, exception.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }