private void btnAction_Click(object sender, EventArgs e)
        {
            if (!User.UserInAction("Purchase Order Action"))
            {
                return;
            }
            if (UcPOGrid.POGrid.GetFocusedRow() is PurchaseOrders purchaseOrders)
            {
                try
                {
                    frmDocActions frm = new frmDocActions("PurchaseOrders",
                                                          purchaseOrders?.Employees?.EmployeeName + " - " + purchaseOrders?.EquipmentTypes?.EquipmentType, purchaseOrders.Id);

                    frmDocActions res = frm.ShowDialogResult() as frmDocActions;
                    if (!res.HasAction)
                    {
                        return;
                    }
                    var unitOfWork = new UnitOfWork();
                    unitOfWork.DocActionsRepo.Insert(res.DocActions);
                    unitOfWork.Save();
                }
                catch (Exception exception)
                {
                    MessageBox.Show(exception.Message, exception.Message, MessageBoxButtons.OK,
                                    MessageBoxIcon.Exclamation);
                }
            }
        }
        private void btnAction_Click(object sender, EventArgs e)
        {
            if (!User.UserInAction("New Equipment Profile Action"))
            {
                return;
            }

            frmDocActions frm = new frmDocActions(tableName: "PPEs",
                                                  label: PPEs?.Employees?.EmployeeName + " - " + PPEs?.EquipmentTypes?.EquipmentType, refId: this.PropertyId);

            frmDocActions res = frm.ShowDialogResult() as frmDocActions;

            if (!res.HasAction)
            {
                return;
            }

            try
            {
                using (var unitOfWork = new UnitOfWork())
                {
                    unitOfWork.DocActionsRepo.Insert(res.DocActions);
                    unitOfWork.Save();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "New Action", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            LoadEquipmentProfiles();
        }
Example #3
0
 private void btnEditRepo_ButtonPressed(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
 {
     if (ActionGrid.GetFocusedRow() is DocActions item)
     {
         frmDocActions frm = new frmDocActions(tableName: "WorkOrders", refId: WOId, label: WorkOrders?.Employees?.EmployeeName + " - " + WorkOrders?.PPEs?.EquipmentTypes?.EquipmentType)
         {
             DocActions = item,
             MethodType = MethodType.Edit,
         };
         frm.ShowDialog();
     }
 }
Example #4
0
        private void btnAction_Click(object sender, EventArgs e)
        {
            if (!User.UserInAction("Work Order Action"))
            {
                return;
            }
            frmDocActions frm = new frmDocActions(tableName: "WorkOrders", refId: WOId,
                                                  label: WorkOrders?.Employees?.EmployeeName + " - " + WorkOrders?.PPEs?.EquipmentTypes?.EquipmentType);

            var res = frm.ShowDialogResult();

            LoadActions();
        }
Example #5
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 #6
0
 private void btnAction_Click(object sender, EventArgs e)
 {
     if (this.DocumentGridView.GetFocusedRow() is Documents item)
     {
         frmDocActions frm = new frmDocActions(MethodType.Add, new DocumentActions()
         {
             ControlNo = item.ControlNo,
             RefId     = item.Id,
             TableName = "Documents",
         });
         frm.ShowDialog();
         Details(item);
         Init();
     }
 }
Example #7
0
 private void btnAddAction_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
 {
     if (DashboardGridView.GetFocusedRow() is DocumentActions item)
     {
         frmDocActions frm = new frmDocActions(MethodType.Add, new DocumentActions()
         {
             TableName   = item.TableName,
             ActionDate  = DateTime.Now,
             RefId       = item.RefId,
             CreatedBy   = User.UserId,
             DateCreated = DateTime.Now,
             ControlNo   = item.ControlNo,
             Year        = item.Year
         });
         frm.ShowDialog();
         Init();
     }
 }
Example #8
0
        private void btnAction_Click(object sender, EventArgs e)
        {
            if (!User.UserInAction("Deliveries Action"))
            {
                return;
            }
            try
            {
                if (DeliveriesGrid.GetFocusedRow() is Deliveries item)
                {
                    frmDocActions frm = new frmDocActions(tableName: "Deliveries",
                                                          label: item.Offices.OfficeName,
                                                          refId: item.Id);

                    var res = frm.ShowDialogResult();
                    Details(item);
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message, exception.Message, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #9
0
        private void btnAction_Click(object sender, EventArgs e)
        {
            if (!User.UserInAction("Work Order Action"))
            {
                return;
            }
            try
            {
                if (UcTechSpecGrid.GridView.GetFocusedRow() is TechSpecs item)
                {
                    frmDocActions frm = new frmDocActions(tableName: "TechSpecs",
                                                          label: item?.Employees?.EmployeeName + " - " + item?.EquipmentTypes?.EquipmentType,
                                                          refId: item.Id);

                    var res = frm.ShowDialogResult();
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message, "Load Tech Specs", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }

            LoadActions();
        }