private DataSet SignerCC(int quoteNum) { //returns a list of signers (doc + non-arthrex ppl) and cc's (reps) //parsed in GetSignersAndCCs method DataSet dsResults = new DataSet(); using (DynamicQueryAdapter querySigners = new DynamicQueryAdapter(oTrans)) { //Create QuoteNum parameter QueryExecutionDataSet parameters = new QueryExecutionDataSet(); DataRow paramRow = parameters.ExecutionParameter.NewRow(); paramRow["ParameterID"] = "QuoteNum"; paramRow["ParameterValue"] = quoteNum; paramRow["ValueType"] = "int"; paramRow["IsEmpty"] = "False"; parameters.ExecutionParameter.Rows.Add(paramRow); //Call JRF-QuoteCnts_HelloSign querySigners.BOConnect(); querySigners.ExecuteByID("JRF-QuoteCnts_HelloSign", parameters); dsResults = querySigners.QueryResults; querySigners.Dispose(); } return(dsResults); }
private static void edvRcvDtl_EpiViewNotification(EpiDataView view, EpiNotifyArgs args) { // ** Argument Properties and Uses ** // view.dataView[args.Row]["FieldName"] // args.Row, args.Column, args.Sender, args.NotifyType // NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes if ((args.NotifyType == EpiTransaction.NotifyType.Initialize)) { if ((args.Row > -1)) { DynamicQueryAdapter adapterDynamicQuery = new DynamicQueryAdapter(oTrans); adapterDynamicQuery.BOConnect(); adapterDynamicQuery.ExecuteByID("DMR"); DataView TB2 = new DataView(adapterDynamicQuery.QueryResults.Tables["Results"]); TB2.RowFilter = "DMRHead_Company = '" + view.dataView[args.Row]["Company"].ToString() + "' AND DMRActn_PackSlip = '" + view.dataView[args.Row]["PackSlip"].ToString() + "' AND DMRActn_PackLine='" + view.dataView[args.Row]["PackLine"].ToString() + "'"; txtUAIQty.Text = Convert.ToString(Convert.ToDouble("0" + view.dataView[args.Row]["FailedQty"].ToString()) - Convert.ToDouble("0" + TB2.ToTable().Compute("Max(DMRActn_Quantity)", string.Empty).ToString())); txtFinalQty.Text = Convert.ToString(Convert.ToDouble("0" + view.dataView[args.Row]["PassedQty"].ToString()) + Convert.ToDouble("0" + view.dataView[args.Row]["FailedQty"].ToString()) - Convert.ToDouble("0" + TB2.ToTable().Compute("Max(DMRActn_Quantity)", string.Empty).ToString())); adapterDynamicQuery.Dispose(); } } }
/** Same function as in Part Entry Form**/ private void FillVehicleGrid(String vPartNum, String vRevisionNum) { try { DynamicQueryAdapter ad = new DynamicQueryAdapter(oTrans); ad.BOConnect(); QueryExecutionDataSet parameters = new QueryExecutionDataSet(); parameters.Tables["ExecutionParameter"].Rows.Add("vPartNum", vPartNum, "nvarchar", false, Guid.NewGuid(), "A"); parameters.Tables["ExecutionParameter"].Rows.Add("vRevision", vRevisionNum, "nvarchar", false, Guid.NewGuid(), "A"); ad.ExecuteByID("RAN_DEL_VehicleTable", parameters); gridVehicle.DataSource = ad.QueryResults.Tables["Results"]; ad.Dispose(); //Hide Columns this.gridVehicle.DisplayLayout.Bands[0].Columns["UD100_Company"].Hidden = true; this.gridVehicle.DisplayLayout.Bands[0].Columns["UD100A_ChildKey1"].Hidden = true; this.gridVehicle.DisplayLayout.Bands[0].Columns["UD100A_ChildKey2"].Hidden = true; //Set Format this.gridVehicle.DisplayLayout.Bands[0].Columns["UD100_Number01"].Format = "###,###,###,##0.0"; this.gridVehicle.DisplayLayout.Bands[0].Columns["UD100_Number02"].Format = "###,###,###,##0.0"; //Disable Columns this.gridVehicle.DisplayLayout.Bands[0].Columns["UD100_Key1"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; this.gridVehicle.DisplayLayout.Bands[0].Columns["UD100_Key2"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; this.gridVehicle.DisplayLayout.Bands[0].Columns["UD100_Key3"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; this.gridVehicle.DisplayLayout.Bands[0].Columns["UD100_Key4"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; this.gridVehicle.DisplayLayout.Bands[0].Columns["UD100_Key5"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; this.gridVehicle.DisplayLayout.Bands[0].Columns["UD100_Number01"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; this.gridVehicle.DisplayLayout.Bands[0].Columns["UD100_Number02"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; this.gridVehicle.DisplayLayout.Bands[0].Columns["Calculated_Check"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; foreach (UltraGridRow row in gridVehicle.Rows) { row.Appearance.BackColorDisabled = System.Drawing.Color.White; row.Appearance.ForeColorDisabled = System.Drawing.Color.Black; } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
private void FillVehicleGrid(String vPartNum, String vRevisionNum) { try { DynamicQueryAdapter ad = new DynamicQueryAdapter(oTrans); ad.BOConnect(); QueryExecutionDataSet parameters = new QueryExecutionDataSet(); parameters.Tables["ExecutionParameter"].Rows.Add("vPartNum", vPartNum, "nvarchar", false, Guid.NewGuid(), "A"); parameters.Tables["ExecutionParameter"].Rows.Add("vRevision", vRevisionNum, "nvarchar", false, Guid.NewGuid(), "A"); ad.ExecuteByID("RAN_DEL_VehicleTable", parameters); ugdVehicle.DataSource = ad.QueryResults.Tables["Results"]; ad.Dispose(); // foreach(Infragistics.Win.UltraWinGrid.UltraGridColumn curColumn in ugdVehicle.DisplayLayout.Bands[0].Columns) // { // curColumn.Hidden = true; // } // // //Unhide the "columns" // ugdVehicle.DisplayLayout.Bands[0].Columns["UD100_Key1"].Hidden = false; // ugdVehicle.DisplayLayout.Bands[0].Columns["UD100_Key2"].Hidden = false; // ugdVehicle.DisplayLayout.Bands[0].Columns["UD100_Key3"].Hidden = false; // ugdVehicle.DisplayLayout.Bands[0].Columns["UD100_Key4"].Hidden = false; // ugdVehicle.DisplayLayout.Bands[0].Columns["UD100_Key5"].Hidden = false; // ugdVehicle.DisplayLayout.Bands[0].Columns["UD100_Number01"].Hidden = false; // ugdVehicle.DisplayLayout.Bands[0].Columns["UD100_Number02"].Hidden = false; // ugdVehicle.DisplayLayout.Bands[0].Columns["Calculated_Check"].Hidden = false; // ugdVehicle.Rows.Band.Columns["Calculated_Check"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.CheckBox; // // ugdVehicle.DisplayLayout.Override.SelectedAppearancesEnabled = Infragistics.Win.DefaultableBoolean.False; // ugdVehicle.DisplayLayout.Override.ActiveAppearancesEnabled = Infragistics.Win.DefaultableBoolean.False; //Hide Columns ugdVehicle.DisplayLayout.Bands[0].Columns["UD100_Company"].Hidden = true; ugdVehicle.DisplayLayout.Bands[0].Columns["UD100A_ChildKey1"].Hidden = true; ugdVehicle.DisplayLayout.Bands[0].Columns["UD100A_ChildKey2"].Hidden = true; //Set Format ugdVehicle.DisplayLayout.Bands[0].Columns["UD100_Number01"].Format = "###,###,###,##0.0"; ugdVehicle.DisplayLayout.Bands[0].Columns["UD100_Number02"].Format = "###,###,###,##0.0"; //Disable Columns this.ugdVehicle.DisplayLayout.Bands[0].Columns["UD100_Key1"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; this.ugdVehicle.DisplayLayout.Bands[0].Columns["UD100_Key2"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; this.ugdVehicle.DisplayLayout.Bands[0].Columns["UD100_Key3"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; this.ugdVehicle.DisplayLayout.Bands[0].Columns["UD100_Key4"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; this.ugdVehicle.DisplayLayout.Bands[0].Columns["UD100_Key5"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; this.ugdVehicle.DisplayLayout.Bands[0].Columns["UD100_Number01"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; this.ugdVehicle.DisplayLayout.Bands[0].Columns["UD100_Number02"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.Disabled; //Disable BackColor Columns //this.ugdVehicle.DisplayLayout.Bands[0].Columns["UD100_Key1"].Appearance.BackColorDisabled = System.Drawing.Color.White; // args.Row.Cells["UD100_Key1"].Appearance.ForeColorDisabled = System.Drawing.Color.Black; // args.Row.Cells["UD100_Key2"].Appearance.BackColorDisabled = System.Drawing.Color.White; // args.Row.Cells["UD100_Key3"].Appearance.BackColorDisabled = System.Drawing.Color.White; // args.Row.Cells["UD100_Key4"].Appearance.BackColorDisabled = System.Drawing.Color.White; // args.Row.Cells["UD100_Key5"].Appearance.BackColorDisabled = System.Drawing.Color.White; // args.Row.Cells["UD100_Number01"].Appearance.BackColorDisabled = System.Drawing.Color.White; // args.Row.Cells["UD100_Number02"].Appearance.BackColorDisabled = System.Drawing.Color.White; foreach (UltraGridRow row in ugdVehicle.Rows) { row.Appearance.BackColorDisabled = System.Drawing.Color.White; row.Appearance.ForeColorDisabled = System.Drawing.Color.Black; } } catch (Exception ex) { //MessageBox.Show(ex.ToString()); } }
private static void oTrans_receiptAdapter_BeforeAdapterMethod(object sender, BeforeAdapterMethodArgs args) { // ** Argument Properties and Uses ** // ** args.MethodName ** // ** Add Event Handler Code ** // ** Use MessageBox to find adapter method name // EpiMessageBox.Show(args.MethodName) switch (args.MethodName) { case "UpdateMaster": if (edvRcvHead.dataView[edvRcvHead.Row]["Company"].ToString() == "19268A") { if (edvMultiKeySearch.dataView[edvMultiKeySearch.Row]["PackSlip"].ToString() == "") { DynamicQueryAdapter adapterDynamicQuery = new DynamicQueryAdapter(oTrans); adapterDynamicQuery.BOConnect(); adapterDynamicQuery.ExecuteByID("GRN_Head"); DataView TB2 = new DataView(adapterDynamicQuery.QueryResults.Tables["Results"]); TB2.RowFilter = "SUBSTRING(RcvHead_PackSlip,1,3) = 'G22'"; string MaxNo = Convert.ToString(TB2.ToTable().Compute("Max(RcvHead_PackSlip)", string.Empty)); if (MaxNo == "") { MaxNo = "00000000000"; } int RNo = int.Parse(MaxNo.Substring(3, 7)) + 1; string RunningNo = RNo.ToString().PadLeft(7, '0'); edvMultiKeySearch.dataView[edvMultiKeySearch.Row]["PackSlip"] = "G22" + RunningNo; adapterDynamicQuery.Dispose(); } } if (edvRcvHead.dataView[edvRcvHead.Row]["Company"].ToString() == "19268B") { if (edvMultiKeySearch.dataView[edvMultiKeySearch.Row]["PackSlip"].ToString() == "") { DynamicQueryAdapter adapterDynamicQuery = new DynamicQueryAdapter(oTrans); adapterDynamicQuery.BOConnect(); adapterDynamicQuery.ExecuteByID("GRN_Head"); DataView TB2 = new DataView(adapterDynamicQuery.QueryResults.Tables["Results"]); TB2.RowFilter = "SUBSTRING(RcvHead_PackSlip,1,3) = 'G25'"; string MaxNo = Convert.ToString(TB2.ToTable().Compute("Max(RcvHead_PackSlip)", string.Empty)); if (MaxNo == "") { MaxNo = "00000000000"; } int RNo = int.Parse(MaxNo.Substring(3, 7)) + 1; string RunningNo = RNo.ToString().PadLeft(7, '0'); edvMultiKeySearch.dataView[edvMultiKeySearch.Row]["PackSlip"] = "G25" + RunningNo; adapterDynamicQuery.Dispose(); } } if (edvRcvHead.dataView[edvRcvHead.Row]["Company"].ToString() == "19268") { DynamicQueryAdapter adapterDynamicQuery = new DynamicQueryAdapter(oTrans); adapterDynamicQuery.BOConnect(); adapterDynamicQuery.ExecuteByID("SO_CrossComp"); DataView TB2 = new DataView(adapterDynamicQuery.QueryResults.Tables["Results"]); TB2.RowFilter = "OrderHed_Company = '19268A' AND OrderHed_ICPONum = '" + edvRcvHead.dataView[edvRcvHead.Row]["PONum"].ToString() + "'"; //MessageBox.Show(TB2.Count.ToString()); if (TB2.Count == 0) { MessageBox.Show("Please ensure CHPE SO already been approved."); edvRcvHead.dataView[edvRcvHead.Row]["PONum"] = ""; } adapterDynamicQuery.Dispose(); } break; } }
private static void oTrans_adapter_BeforeAdapterMethod(object sender, BeforeAdapterMethodArgs args) { // ** Argument Properties and Uses ** // ** args.MethodName ** // ** Add Event Handler Code ** // ** Use MessageBox to find adapter method name //MessageBox.Show(args.MethodName); switch (args.MethodName) { case "Update": if (edvPart.Row > -1) { if (edvPart.CurrentDataRow.RowState.ToString() == "Added") { if ((edvPart.dataView[edvPart.Row]["ClassID"].ToString() == "FG") || (edvPart.dataView[edvPart.Row]["ClassID"].ToString() == "SFG")) { if (edvPart.dataView[edvPart.Row]["PartNum"].ToString() == "") { DynamicQueryAdapter adapterDynamicQuery = new DynamicQueryAdapter(oTrans); adapterDynamicQuery.BOConnect(); adapterDynamicQuery.ExecuteByID("ItemMaster"); DataView TB2 = new DataView(adapterDynamicQuery.QueryResults.Tables["Results"]); string P01 = edvPart.dataView[edvPart.Row]["ShortChar02"].ToString(); TB2.RowFilter = "SUBSTRING(Part_PartNum,1,2) = '" + P01.Substring(0, 2) + "'"; string MaxNo = Convert.ToString(TB2.ToTable().Compute("Max(Calculated_FGCode)", string.Empty)); if (MaxNo == "") { MaxNo = "00000000"; } int RNo = int.Parse(MaxNo.Substring(3, 5)) + 1; string RunningNo = RNo.ToString().PadLeft(5, '0'); if (edvPart.dataView[edvPart.Row]["ClassID"].ToString() == "SFG") { edvPart.dataView[edvPart.Row]["PartNum"] = P01 + RunningNo + "KT"; } else { edvPart.dataView[edvPart.Row]["PartNum"] = P01 + RunningNo; } adapterDynamicQuery.Dispose(); } edvPart.dataView[edvPart.Row]["Character01"] = ""; edvPart.dataView[edvPart.Row]["CostMethod"] = "S"; } else if ((edvPart.dataView[edvPart.Row]["ClassID"].ToString() == "CT") || (edvPart.dataView[edvPart.Row]["ClassID"].ToString() == "DM") || (edvPart.dataView[edvPart.Row]["ClassID"].ToString() == "IM") || (edvPart.dataView[edvPart.Row]["ClassID"].ToString() == "PK")) { if (edvPart.dataView[edvPart.Row]["PartNum"].ToString() == "") { DynamicQueryAdapter adapterDynamicQuery = new DynamicQueryAdapter(oTrans); adapterDynamicQuery.BOConnect(); adapterDynamicQuery.ExecuteByID("ItemMaster"); DataView TB2 = new DataView(adapterDynamicQuery.QueryResults.Tables["Results"]); string P01 = edvPart.dataView[edvPart.Row]["Character01"].ToString(); P01 = P01.Substring(0, 4); TB2.RowFilter = "SUBSTRING(Part_PartNum,1,4) = '" + P01 + "'"; string MaxNo = Convert.ToString(TB2.ToTable().Compute("Max(Part_PartNum)", string.Empty)); if (MaxNo == "") { MaxNo = "0000000000"; } MessageBox.Show(MaxNo.Substring(5, 5)); int RNo = int.Parse(MaxNo.Substring(5, 5)) + 1; string RunningNo = RNo.ToString().PadLeft(5, '0'); edvPart.dataView[edvPart.Row]["PartNum"] = P01 + "-" + RunningNo; adapterDynamicQuery.Dispose(); } edvPart.dataView[edvPart.Row]["ShortChar02"] = ""; edvPart.dataView[edvPart.Row]["CostMethod"] = "A"; } else { cbMType.ReadOnly = true; cbFType.ReadOnly = true; edvPart.dataView[edvPart.Row]["CostMethod"] = "S"; } } } break; } }