Exemplo n.º 1
0
        private void btnEditPo_Click(object sender, EventArgs e)
        {
            if (!User.UserInAction("Edit Tech Spec"))
            {
                return;
            }
            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);
            }
        }
Exemplo n.º 2
0
        private void btnNewPO_Click(object sender, EventArgs e)
        {
            if (!User.UserInAction("Add Tech Spec"))
            {
                return;
            }
            frmAddEditTechSpecs frm = new frmAddEditTechSpecs()
            {
                MethodType   = MethodType.Add,
                frmTechSpecs = this
            };
            frmAddEditTechSpecs res = frm.ShowDialogResult() as frmAddEditTechSpecs;

            UcTechSpecGrid.CreateUcControl();
            if (UcTechSpecGrid.GridView.GetFocusedRow() is TechSpecs item)
            {
                TechSpecDetails.Details(item);
                lblPODescription.Text = item.TechSpecsId;
                ucTSEquipmentProfiles1.Details(item.Id, "TechSpecs");
            }
            var rowHandle = this.UcTechSpecGrid.GridView.LocateByValue("Id", res.TechSpecsId);

            this.UcTechSpecGrid.GridView.FocusedRowHandle = rowHandle;
            this.UcTechSpecGrid.GridView.MakeRowVisible(rowHandle);
        }
Exemplo n.º 3
0
        public void NewTS(WorkOrders workOrders)
        {
            frmAddEditTechSpecs frm = new frmAddEditTechSpecs(workOrders)
            {
                MethodType   = MethodType.Add,
                frmTechSpecs = this
            };

            frm.ShowDialog();
            UcTechSpecGrid.CreateUcControl();
            if (UcTechSpecGrid.GridView.GetFocusedRow() is TechSpecs item)
            {
                TechSpecDetails.Details(item);
                lblPODescription.Text = item.TechSpecsId;
                ucTSEquipmentProfiles1.Details(item.Id, "TechSpecs");
            }
        }