public ServiceRequestsWinController(RequestRecordGivenOut rec, RequestWindowPuropse mode, ServiceRequests servReq, Form parentReq) { serviceRequests = servReq; this.requestWindow = parentReq; this.purposeOfTheWindow = mode; catchTheControls(); adjustGivenOutRecFields(rec); }
public FormServiceRequestsWindow(RequestRecordGivenOut rec, RequestWindowPuropse mode, Form parMain, ServiceRequests servRequ) { this.parentMainWin = parMain; InitializeComponent(); requestController = new ServiceRequestsWinController(rec, mode, servRequ, this); this.Show(); parentMainWin.Hide(); }
/// <summary> /// adjust the window-view on the window if given-out record is comming /// possible modes are /// </summary> /// <param name="rec">givenout record</param> private void adjustGivenOutRecFields(RequestRecordGivenOut rec) { fillUpGivenOutFields(rec); if (purposeOfTheWindow == RequestWindowPuropse.DetailsOfGivenOut) { adjustReadOnlyCase(); buttonOk.Visible = false; } else if (purposeOfTheWindow == RequestWindowPuropse.GetBackTheGivenOut) { adjustReadOnlyCase(); buttonOk.Visible = true; buttonOk.Text = "Visszavétel"; } }
/// <summary> /// fills up the text of GivenOut records to the fields /// </summary> /// <param name="rec">givenout record</param> private void fillUpGivenOutFields(RequestRecordGivenOut rec) { textBoxName.Text = rec.userKeroNev; textBoxArea.Text = rec.userTerulet; textBoxStartDate.Text = rec.keresDatum; textBoxEndDate.Text = rec.teljesites; textBoxAmount.Text = Convert.ToString(rec.keresMennyiseg); comboBoxProducts.Items.Add(rec.termekNev); comboBoxProducts.SelectedIndex = 0; comboBoxStrippings.Items.Add(rec.termekKiszerel); comboBoxStrippings.SelectedIndex = 0; textBoxPlacing.Visible = false; textBoxSubcontr.Text = rec.termekBeszall; labelPlacing.Visible = false; infoLabel.Text = "Kiadott kérés\n"; if (rec.keresModosNev != "") { infoLabel.Text += "Kiadta: " + rec.keresModosNev; } userIdOfRequester = rec.userId; oldStrippingID = rec.termekQuantId; }