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); }
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); } }
private void TxtSearch_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { var item = UcTechSpecGrid.Search(UcTechSpecGrid.txtSearch.Text)?.FirstOrDefault(); if (item == null) { return; } TechSpecDetails.Details(item); lblPODescription.Text = item.TechSpecsId; ucTSEquipmentProfiles1.Details(item.Id, "TechSpecs"); this.DocumentBindingSource.DataSource = new UnitOfWork().DocumentsRepo.Get(m => m.RefId == item.Id && m.TableName == "TechSpecs"); LoadActions(); } }
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"); } }
private void frmTechSpecs_Load(object sender, EventArgs e) { UcTechSpecGrid.CreateUcControl(); UcTechSpecGrid.GridView.FocusedRowChanged += GridView_FocusedRowChanged; UcTechSpecGrid.txtSearch.KeyDown += TxtSearch_KeyDown; }