private void findButton_Click(object sender, EventArgs e) { PhysicalMainDataSet set = phyMainSet; bookmark.Get(); AppHelper.ResetGridDataSource(physicalGrid); if (dateCheck.Checked == true) { set.From = fromDateEdit.Value.ToString(AppRes.csDateFormat); set.To = toDateEdit.Value.ToString(AppRes.csDateFormat); } else { set.From = ""; set.To = ""; } set.AreaNo = (EReportArea)areaCombo.SelectedValue; set.ReportApproval = (EReportApproval)approvalCombo.SelectedValue; set.ProductNo = itemNoEdit.Text.Trim(); set.RecNo = jobNoEdit.Text.Trim(); set.Select(); AppHelper.SetGridDataSource(physicalGrid, set); bookmark.Goto(); physicalGrid.Focus(); }
private void Insert() { EReportArea area = profJobSet.AreaNo; if (profJobSet.Empty == true) { return; } if (area == EReportArea.None) { return; } if (string.IsNullOrWhiteSpace(profJobSet.ItemNo) == true) { return; } phyCheckSet.From = ""; phyCheckSet.To = ""; phyCheckSet.AreaNo = area; phyCheckSet.ReportApproval = EReportApproval.None; phyCheckSet.ProductNo = profJobSet.ItemNo; phyCheckSet.Select(); if (phyCheckSet.Empty == false) { MessageBox.Show("Can't import physical report because this report already exist in DB!", "SGS", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } phyQuery.Insert(); findButton.PerformClick(); }
private void InsertProduct(ProductColumns col, SqlTransaction trans) { phyQuery.ProfJobSet.Type = EReportType.Physical; phyQuery.ProfJobSet.JobNo = ""; phyQuery.ProfJobSet.AreaNo = bomSet.AreaNo; phyQuery.ProfJobSet.ItemNo = col.Code; phyQuery.ProfJobSet.ExtendASTM = false; phyQuery.ProfJobSet.Select(trans); phyQuery.ProfJobSet.Fetch(); string jobNo = phyQuery.ProfJobSet.JobNo; if (string.IsNullOrWhiteSpace(jobNo) == false) { phyMainSet.RecNo = jobNo; phyMainSet.ReportApproval = EReportApproval.None; phyMainSet.AreaNo = EReportArea.None; phyMainSet.ProductNo = ""; phyMainSet.From = ""; phyMainSet.To = ""; phyMainSet.Select(trans); if (phyMainSet.Empty == true) { phyQuery.Insert(trans); } } productSet.BomNo = bomSet.RecNo; productSet.Valid = false; productSet.AreaNo = bomSet.AreaNo; productSet.Code = col.Code; productSet.JobNo = jobNo; productSet.Name = col.Name; productSet.Image = col.Image; productSet.Insert(trans); }