Using @josecgomez I have created a BAQ Data View on Dashboard Load. I have a data table that publishes Order Num and Order Line. All that works properly. However, I want to embed an updatable dashboard which will subscribe to either the BAQ Data View or the publisher in the Data Table. When I add the Dashboard and go to my custom data table view there aren’t any columns available to select. If I select a column from the BAQ Data View it doesn’t work and subscribe to the Order Num.
Hi @Chris_Conn. Thank you. I"m still working on this… Did you see my post about the Dashboard not subscribing? Maybe you can help!
I’ll need some more info. What do you mean by “go to my custom data table view there arent any columns available to select”?
You may want to share some code, I am especially interested in where you create your dataview and add it to the oTrans.
Okay, I have an Updatable Dashboard that I added to a custom sheet. In the Dashboard I have OrderNum setup for Dashboard Browse.
I have a BAQ Data View:
//Order - Make DataView for Publishing
private void OrderPublisherView()
{
//MessageBox.Show("OrderPublisherView");
DataTable dt1 = new DataTable();
dt1.Columns.Add(new DataColumn("OrderNum",typeof(string)));
dt1.Columns.Add(new DataColumn("OrderLine", typeof(string)));
dt1.Columns.Add(new DataColumn("OrderPONum", typeof(string)));
dt1.Columns.Add(new DataColumn("SysRowID",typeof(Guid)));
var r = dt1.NewRow();
dt1.Rows.Add(r);
EpiDataView edvMyCustomOrderDV = new EpiDataView();
edvMyCustomOrderDV.dataView = dt1.DefaultView;
oTrans.Add("MyCustomOrderView",edvMyCustomOrderDV);
}
This BAQ data view is created on initialization. I am publishing the OrderNum. Once I enter a valid order number into the field it publishes those 4 items.
As you can see the Data View I created doesn’t show any columns that I can subscribe to.
If I highlight a different dataview then there are columns available I can subscribe to.
However, I tested this and this doesn’t work. I dont’ know if it’s because I don’t have that view that has columns available publishing anything. This is how I create that view:
//Order - Order Data View
private void CreateOrderBAQView()
{
//MessageBox.Show("OrderBAQView");
GS_Order_Detail_DataView = new BAQDataView("GS_Order_Detail_DataView");
oTrans.Add("GS_Order_Detail_DataView", GS_Order_Detail_DataView);
var OrderNum = "MyCustomOrderView.OrderNum";
var OrderLine = "MyCustomOrderView.OrderLine";
oTrans.PublishColumnChange(OrderNum, Guid.NewGuid().ToString());
oTrans.PublishColumnChange(OrderLine, Guid.NewGuid().ToString());
var OrderNumPub = oTrans.GetPublisher(OrderNum);
var OrderLinePub = oTrans.GetPublisher(OrderLine);
GS_Order_Detail_DataView.SubscribeToPublisher(OrderNumPub.PublishName, "OrderDtl_OrderNum");
GS_Order_Detail_DataView.SubscribeToPublisher(OrderLinePub.PublishName, "OrderDtl_OrderLine");
}
I know the OrderPublisherView() is working because when I enter a valid order number in there the GS_Order_Detail_DataView refreshes. For some reason though my Dashboard will not subscribe to it. If I enter the number into the Dashboard manually and refresh then it will populate with the correct data.
I think the problem is you arent publishing properly - you should be using your registered view name (which is GS_Order_Detail_DataView not MyCustomOrderView)
var OrderNum = “GS_Order_Detail_DataView.OrderNum”;
Okay I tried that and it doesn’t work at all. I think maybe I didn’t share my publisher code. The MyCustomOrderView is this code and it is the one that publishes.
//Order - Make DataView for Publishing
private void OrderPublisherView()
{
//MessageBox.Show("OrderPublisherView");
DataTable dt1 = new DataTable();
dt1.Columns.Add(new DataColumn("OrderNum",typeof(string)));
dt1.Columns.Add(new DataColumn("OrderLine", typeof(string)));
dt1.Columns.Add(new DataColumn("OrderPONum", typeof(string)));
dt1.Columns.Add(new DataColumn("SysRowID",typeof(Guid)));
var r = dt1.NewRow();
dt1.Rows.Add(r);
EpiDataView edvMyCustomOrderDV = new EpiDataView();
edvMyCustomOrderDV.dataView = dt1.DefaultView;
oTrans.Add("MyCustomOrderView",edvMyCustomOrderDV);
}```
Is this also called in initialize? Keep in mind the order of all of the events matters.
I am confused in general. So there is a dashboard, an EpiDataView (MyCustomOrderView) and a BAQDataView(GS_Order_Detail_DataView). I dont understand how these 3 items are supposed to interact.
The one that is publishing the Order Num is the first item in initialization. The only items that need to interact are the EpiDataView (MyCustomOrderView) and the Dashboard. The EpiDataView has columns that are published and I want to have the Dashboard Subscribe to it but It’s not available to subscribe to. Jose Gomez helped me with some of this.
But isnt your Publishing using “MyCustomOrderView.OrderNum”? If MyCustomOrderView hasnt been created yet, that wont work.
// **************************************************
//Custom code for MainController
//Created: 9/15/2018 11:34:11 AM
//**************************************************
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Ice.BO;
using Ice.UI;
using Ice.Lib;
using Ice.Adapters;
using Ice.Lib.Customization;
using Ice.Lib.ExtendedProps;
using Ice.Lib.Framework;
using Ice.Lib.Searches;
using Ice.UI.FormFunctions;
using Infragistics.Win.UltraWinGrid;
using Ice.Lib.Broadcast;
using System.Reflection;
using Erp.Adapters;
public class Script
{
// ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added Module Level Variables' Comments! **
// Begin Wizard Added Module Level Variables **
private EpiDataView edvGS_Customer_DataView;
private EpiDataView edvGS_Order_Detail_DataView;
private EpiDataView edvGS_Quote_DataView;
// End Wizard Added Module Level Variables **
// Add Custom Module Level Variables Here **
private string custid;
private int ordernum;
private int orderline;
private int qty;
private int grdiquoteqty;
private int numcolors;
private string quotepartnum;
private string partnum;
private string quotenum;
private int newquoteqty;
private string newquotepartnum;
private int newnumcolors;
private int newqtybreaks;
private string newcustid;
private string neworderqty;
private string neworderpartnum;
private string ordernumcolors;
private int neworderqtybreaks;
private string ordercustid;
private string newordernum;
private string neworderline;
private string enflowID;
private EpiDataView edvV_GS_Quotes_1View;
private EpiDataView edvV_GS_Invoices_1View;
private System.Windows.Forms.WebBrowser wbSite; //Attachment View in Order
private System.Windows.Forms.WebBrowser wbSite2; //Attachments List View Preview in Order Attachments Tab
private System.Windows.Forms.WebBrowser wbSite3;
private System.Windows.Forms.WebBrowser wbSite4;
private System.Windows.Forms.WebBrowser wbSite5; //Invoice Letter Preview
private System.Windows.Forms.WebBrowser wbSite6;
private BAQDataView GS_UD09_Movement_DataView;
private BAQDataView GS_Order_Workflow_DataView;
private BAQDataView GS_Misc_Charges_DataView;
private BAQDataView GS_Order_Invoice_DataView;
private BAQDataView GS_Invoice_LetterUD15_DataView;
private BAQDataView GS_Customer_DataView;
private BAQDataView GS_Order_Detail_DataView;
private BAQDataView GS_Quote_DataView;
private BAQDataView GS_Order_Notes;
private EpiDataView edvMyCustomDV;
private EpiDataView edvMyCustomOrderDV;
private EpiDataView edvMyCustomQuoteDV;
public void InitializeCustomCode()
{
// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
// Begin Wizard Added Variable Initialization
MainController.KeyPreview = true;
// End Wizard Added Variable Initialization
// Begin Wizard Added Custom Method Calls
//MessageBox.Show("1");
CustomerPublisherView();
OrderPublisherView();
QuotePublisherView();
CreateMovementBAQView();
CreateWorkflowBAQView();
CreateMiscChargesBAQView();
//MessageBox.Show("2");
CreateCustomerBAQView();
CreateInvoiceBAQView();
CreateInvoicePreviewBAQView();
CreateOrderBAQView();
CreateQuoteBAQView();
CreateOrderNotesBAQView();
//MessageBox.Show("3");
//this.edvV_GS_Quotes_1View = ((EpiDataView)(this.oTrans.EpiDataViews["V_GS_Quotes_1View"]));
this.edvGS_Customer_DataView = ((EpiDataView)(this.oTrans.EpiDataViews["GS_Customer_DataView"]));
//MessageBox.Show("3b");
this.edvGS_Order_Detail_DataView = ((EpiDataView)(this.oTrans.EpiDataViews["GS_Order_Detail_DataView"]));
//MessageBox.Show("3c");
this.edvGS_Quote_DataView = ((EpiDataView)(this.oTrans.EpiDataViews["GS_Quote_DataView"]));
//MessageBox.Show("4");
grid_QuoteLetterPrev = (EpiUltraGrid)csm.GetNativeControlReference("2c21a74b-e009-4d50-a7d7-9442c68eba4c");
//MessageBox.Show("5");
grid_Attachments = (EpiUltraGrid)csm.GetNativeControlReference("6be52172-491c-40d5-89c8-6733d44ae5e4");
//MessageBox.Show("6");
tbMovementToDept = (EpiTextBox)csm.GetNativeControlReference("b2c3c916-7189-47c8-bed1-11c6bba9e433");
//MessageBox.Show("7");
epiTextQS_CustID = (EpiTextBox)csm.GetNativeControlReference("d8c54370-5630-4ad0-a0de-a2d5d7601513");
//MessageBox.Show("8");
this.btnChecklist.Click += new System.EventHandler(this.btnChecklist_Click);
this.btn_enFlow.Click += new System.EventHandler(this.btn_enFlow_Click);
this.btn_SalesOrderSearch.Click += new System.EventHandler(this.btn_SalesOrderSearch_Click);
this.btnQS_NewQuote.Click += new System.EventHandler(this.btnQS_NewQuote_Click);
this.btnQS_CustID.Click += new System.EventHandler(this.btnQS_CustID_Click);
this.btnQS_Part.Click += new System.EventHandler(this.btnQS_Part_Click);
this.btn_QS_Num1.Click += new System.EventHandler(this.btn_QS_Num1_Click);
//MessageBox.Show("9");
this.btn_QS_editquo1.Click += new System.EventHandler(this.btn_QS_editquo1_Click);
this.btnExpediting.Click += new System.EventHandler(this.btnExpediting_Click);
this.btnOrderQuickNotes.Click += new System.EventHandler(this.btnOrderQuickNotes_Click);
this.btnCreateNon_Conformance.Click += new System.EventHandler(this.btnCreateNon_Conformance_Click);
this.btn_Cust_CustID.Click += new System.EventHandler(this.btn_Cust_CustID_Click);
this.btnQuoteClearForm.Click += new System.EventHandler(this.btnQuoteClearForm_Click);
//MessageBox.Show("10");
this.btnOrderView.Click += new System.EventHandler(this.btnOrderView_Click);
this.btn_QuoteFromOrder.Click += new System.EventHandler(this.btn_QuoteFromOrder_Click);
this.btnShipstore.Click += new System.EventHandler(this.btnShipstore_Click);
this.btnChangeShipping.Click += new System.EventHandler(this.btnChangeShipping_Click);
this.btnNewProspectEntry.Click += new System.EventHandler(this.btnNewProspectEntry_Click);
//MessageBox.Show("11");
this.btnQuickNoteLaunch.Click += new System.EventHandler(this.btnQuickNoteLaunch_Click);
this.tbOrderLineRef.GotFocus += new System.EventHandler(this.tbOrderLineRef_GotFocus);
this.tbCustomerIDRef.GotFocus += new System.EventHandler(this.tbCustomerIDRef_GotFocus);
this.gridPOResults.AfterRowActivate += new System.EventHandler(this.gridPOResults_AfterRowActivate);
this.gridLinesCopyChanges.AfterRowActivate += new System.EventHandler(this.gridLinesCopyChanges_AfterRowActivate);
this.grid_Attachments.AfterRowActivate += new System.EventHandler(this.grid_Attachments_AfterRowActivate);
//MessageBox.Show("9");
this.gridPOResults.AfterSelectChange += new Infragistics.Win.UltraWinGrid.AfterSelectChangeEventHandler(this.gridPOResults_AfterSelectChange);
this.gridLinesCopyChanges.AfterSelectChange += new Infragistics.Win.UltraWinGrid.AfterSelectChangeEventHandler(this.gridLinesCopyChanges_AfterSelectChange);
this.baseToolbarsManager.ToolClick += new Infragistics.Win.UltraWinToolbars.ToolClickEventHandler (this.baseToolbarsManager_ToolClick);
this.epiTextQS_CustID.Leave += new System.EventHandler(this.epiTextQS_CustID_Leave);
this.tbOrderOrderNumRef.Leave += new System.EventHandler(this.tbOrderOrderNumRef_Leave);
this.tbOrderPONumRef.Leave += new System.EventHandler(this.tbOrderPONumRef_Leave);
this.tbCustomerIDRef.Leave += new System.EventHandler(this.tbCustomerIDRef_Leave);
this.tbQuoteNumberReference.Leave += new System.EventHandler(this.tbQuoteNumberReference_Leave);
//MessageBox.Show("10");
gridPOResults.Visible = false;
tbOrderOnHold.Visible = false;
tbLineCancelled.Visible = false;
tbOrderCancelled.Visible = false;
tbOrderHasShipped.Visible = false;
tbOrderHasNotShipped.Visible = false;
gridChecklist.Visible = true;
btnOrderView.Visible = false; ////Once Janice makes a call this can be made to true
btnCreateNon_Conformance.Visible = true;
//MessageBox.Show("11");
btnChecklist.Visible = true;
SetupBrowser_AttachmentListView(); //All Attachments Box
SetupBrowser_Attachments(); //Attachments Box
SetupBrowser_QuoteLetter(); //Quote Letter Box
SetupBrowser_ChecklistQueue(); //Checklist Queue
SetupBrowser_enFlowQueue(); //enFlow Queue
SetupBrowser_InvoiceLetter();
LegacyIndicatorLabel.Visible = false;
tbQuoteComment.Visible = false;
tbQuoteLegacyRef2.Visible = false;
//MessageBox.Show("12");
tbChecklistStatus.Visible = false;
tbLegacyInvoice.Visible = false;
tbLegacyInvoicePreview.Visible = false;
tbCreditHold.Visible = false;
tbNoContact.Visible = false;
tbCustomerProspect.Visible = false;
epiTextBoxC2.Visible = false;
tbOrderEditCompleted.Visible = false;
//MessageBox.Show("13");
this.tbOrderNotesNew.Click += new System.EventHandler(this.tbOrderNotesNew_Click);
// End Wizard Added Custom Method Calls
}
public void DestroyCustomCode()
{
// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
// Begin Wizard Added Object Disposal
this.btnNewProspectEntry.Click -= new System.EventHandler(this.btnNewProspectEntry_Click);
this.tbOrderNotesNew.Click -= new System.EventHandler(this.tbOrderNotesNew_Click);
// End Wizard Added Object Disposal
// Begin Custom Code Disposal
this.tbOrderOrderNumRef.Leave += new System.EventHandler(this.tbOrderOrderNumRef_Leave);
this.btn_QuoteFromOrder.Click -= new System.EventHandler(this.btn_QuoteFromOrder_Click);
this.tbCustomerIDRef.Leave -= new System.EventHandler(this.tbCustomerIDRef_Leave);
this.btnQS_NewQuote.Click -= new System.EventHandler(this.btnQS_NewQuote_Click);
this.btnQS_CustID.Click -= new System.EventHandler(this.btnQS_CustID_Click);
this.btnQS_Part.Click -= new System.EventHandler(this.btnQS_Part_Click);
this.btn_QS_Num1.Click -= new System.EventHandler(this.btn_QS_Num1_Click);
this.btn_QS_editquo1.Click -= new System.EventHandler(this.btn_QS_editquo1_Click);
this.btnChangeShipping.Click -= new System.EventHandler(this.btnChangeShipping_Click);
this.btnExpediting.Click -= new System.EventHandler(this.btnExpediting_Click);
this.btnOrderQuickNotes.Click -= new System.EventHandler(this.btnOrderQuickNotes_Click);
this.epiTextQS_CustID.Leave -= new System.EventHandler(this.epiTextQS_CustID_Leave);
this.tbOrderPONumRef.Leave -= new System.EventHandler(this.tbOrderPONumRef_Leave);
this.btnCreateNon_Conformance.Click -= new System.EventHandler(this.btnCreateNon_Conformance_Click);
this.edvV_GS_Quotes_1View = null;
this.btn_Cust_CustID.Click -= new System.EventHandler(this.btn_Cust_CustID_Click);
this.btnQuoteClearForm.Click -= new System.EventHandler(this.btnQuoteClearForm_Click);
this.btnOrderView.Click -= new System.EventHandler(this.btnOrderView_Click);
this.btnShipstore.Click -= new System.EventHandler(this.btnShipstore_Click);
this.btnQuickNoteLaunch.Click -= new System.EventHandler(this.btnQuickNoteLaunch_Click);
this.tbOrderLineRef.GotFocus -= new System.EventHandler(this.tbOrderLineRef_GotFocus);
this.tbCustomerIDRef.GotFocus -= new System.EventHandler(this.tbCustomerIDRef_GotFocus);
this.gridPOResults.AfterSelectChange -= new Infragistics.Win.UltraWinGrid.AfterSelectChangeEventHandler(this.gridPOResults_AfterSelectChange);
this.gridLinesCopyChanges.AfterSelectChange -= new Infragistics.Win.UltraWinGrid.AfterSelectChangeEventHandler(this.gridLinesCopyChanges_AfterSelectChange);
this.gridLinesCopyChanges.AfterRowActivate -= new System.EventHandler(this.gridLinesCopyChanges_AfterRowActivate);
this.btn_enFlow.Click -= new System.EventHandler(this.btn_enFlow_Click);
this.btnChecklist.Click -= new System.EventHandler(this.btnChecklist_Click);
this.tbQuoteNumberReference.Leave -= new System.EventHandler(this.tbCustomerIDRef_Leave);
this.btnNewProspectEntry.Click -= new System.EventHandler(this.btnNewProspectEntry_Click);
this.grid_Attachments.AfterRowActivate -= new System.EventHandler(this.grid_Attachments_AfterRowActivate);
// End Custom Code Disposal
}
//Customer Section Code Begins*********
//Customer - Customer Data View
private void CreateCustomerBAQView()
{
//MessageBox.Show("CustomerBAQ");
GS_Customer_DataView = new BAQDataView("GS_Customer_DataView");
oTrans.Add("GS_Customer_DataView", GS_Customer_DataView);
var CustID = "MyCustomView.CustID";
oTrans.PublishColumnChange(CustID, Guid.NewGuid().ToString());
var CustIDPub = oTrans.GetPublisher(CustID);
GS_Customer_DataView.SubscribeToPublisher(CustIDPub.PublishName, "Customer_CustID");
}
//Customer - Make DataView for Publishing
private void CustomerPublisherView()
{
//MessageBox.Show("CustomerPublisher");
DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("CustID",typeof(string)));
dt.Columns.Add(new DataColumn("SysRowID",typeof(Guid)));
var r = dt.NewRow();
dt.Rows.Add(r);
EpiDataView edvMyCustomDV = new EpiDataView();
edvMyCustomDV.dataView = dt.DefaultView;
oTrans.Add("MyCustomView",edvMyCustomDV);
}
//Customer - On Leave
private void tbCustomerIDRef_Leave(object sender, System.EventArgs args)
{
//MessageBox.Show("CustIDLeave");
changecustomernumber();
}
//Order Focus on Sheet
private void tbCustomerIDRef_GotFocus(object sender, System.EventArgs args)
{
//MessageBox.Show("CustIDFocus");
tbCustomerIDRef.Focus();
}
//Customer ID Search Button in Customer Section
private void btn_Cust_CustID_Click(object sender, System.EventArgs args)
{
SearchOnCustomerAdapterShowDialog_1();
}
//Customer - New Account Prospect Entry
private void btnNewProspectEntry_Click(object sender, System.EventArgs args)
{
LaunchFormOptions lfo = new LaunchFormOptions();
lfo.IsModal = false;
lfo.SuppressFormSearch = true;
System.Collections.Generic.Dictionary<string, string> mylist = new System.Collections.Generic.Dictionary<string, string>();
lfo.ContextValue = mylist;
ProcessCaller.LaunchForm(oTrans, "CRM001", lfo);
}
//Customer ID Search Method in Customer Section
private void SearchOnCustomerAdapterShowDialog_1()
{
//Wizard Generated Search Method
//You will need to call this method from another method in custom code
//For example, [Form]_Load or [Button]_Click
bool recSelected;
string whereClause = string.Empty;
System.Data.DataSet dsCustomerAdapter = Ice.UI.FormFunctions.SearchFunctions.listLookup(this.oTrans, "CustomerAdapter", out recSelected, true, whereClause);
if (recSelected)
{
System.Data.DataRow adapterRow = dsCustomerAdapter.Tables[0].Rows[0];
tbCustomerIDRef.Text = adapterRow["CustID"].ToString();
var myCustomDV = oTrans.Factory("MyCustomView");
myCustomDV.dataView[myCustomDV.Row].BeginEdit();
myCustomDV.dataView[myCustomDV.Row]["CustID"]=tbCustomerIDRef.Text;
myCustomDV.dataView[myCustomDV.Row].EndEdit();
changecustomernumber();
}
}
//Customer - Refreshes Customer View and Populates Grids
private void changecustomernumber()
{
tbNoContact.Visible = false;
tbCreditHold.Visible = false;
epiTextBoxC2.Visible = false;
tbCustomerProspect.Visible = false;
//Customer Attributes Grid
DynamicQueryAdapter dqa1 = new DynamicQueryAdapter(oTrans);
dqa1.BOConnect();
QueryExecutionDataSet qeds1 = dqa1.GetQueryExecutionParametersByID("GS_Customer_Attributes");
qeds1.ExecutionParameter.Clear();
qeds1.ExecutionParameter.AddExecutionParameterRow("CustID", tbCustomerIDRef.Text , "nvarchar", false, Guid.NewGuid(), "B");
dqa1.ExecuteByID("GS_Customer_Attributes", qeds1);
epiUltraGridC3.DataSource = dqa1.QueryResults.Tables["Results"];
//Customer Contacts Grid
DynamicQueryAdapter dqa2 = new DynamicQueryAdapter(oTrans);
dqa2.BOConnect();
QueryExecutionDataSet qeds2 = dqa2.GetQueryExecutionParametersByID("GS_Customer_Contacts");
qeds2.ExecutionParameter.Clear();
qeds2.ExecutionParameter.AddExecutionParameterRow("CustID", tbCustomerIDRef.Text , "nvarchar", false, Guid.NewGuid(), "C");
dqa2.ExecuteByID("GS_Customer_Contacts", qeds2);
epiUltraGridC2.DataSource = dqa2.QueryResults.Tables["Results"];
//Customer Notes
DynamicQueryAdapter dqa3 = new DynamicQueryAdapter(oTrans);
dqa3.BOConnect();
QueryExecutionDataSet qeds3 = dqa3.GetQueryExecutionParametersByID("GS_Customer_Note");
qeds3.ExecutionParameter.Clear();
qeds3.ExecutionParameter.AddExecutionParameterRow("CustNum", tbCustomerIDRef.Text , "nvarchar", false, Guid.NewGuid(), "D");
dqa3.ExecuteByID("GS_Customer_Note", qeds3);
gridCustomerNotes.DataSource = dqa3.QueryResults.Tables["Results"];
//Customer Industry Grid
DynamicQueryAdapter dqa4 = new DynamicQueryAdapter(oTrans);
dqa4.BOConnect();
QueryExecutionDataSet qeds4 = dqa4.GetQueryExecutionParametersByID("GS_Customer_Industry");
qeds4.ExecutionParameter.Clear();
qeds4.ExecutionParameter.AddExecutionParameterRow("CustID", tbCustomerIDRef.Text , "nvarchar", false, Guid.NewGuid(), "E");
dqa4.ExecuteByID("GS_Customer_Industry", qeds4);
gridCustomerIndustry.DataSource = dqa4.QueryResults.Tables["Results"];
CreateRowRuleGS_Customer_DataViewCustomer_CreditHoldEquals_True();;
CreateRowRuleGS_Customer_DataViewCustomer_NoContactEquals_True();;
}
//Customer - Prospect Rule
private void CreateRowRuleGS_Customer_DataViewCustomer_CustomerTypeEquals_PRO()
{
// Description: CustomerType
// **** begin autogenerated code ****
RuleAction[] ruleActions = new RuleAction[0];
// Create RowRule and add to the EpiDataView.
// Dummy Context Object
object contextObject = null;
RowRule rrCreateRowRuleGS_Customer_DataViewCustomer_CustomerTypeEquals_PRO = new RowRule("GS_Customer_DataView.Customer_CustomerType", RuleCondition.Equals, "PRO", new RowRuleActionDelegate2(this.GS_Customer_DataViewCustomer_CustomerTypeEqualsPRO_CustomRuleAction), contextObject);
((EpiDataView)(this.oTrans.EpiDataViews["GS_Customer_DataView"])).AddRowRule(rrCreateRowRuleGS_Customer_DataViewCustomer_CustomerTypeEquals_PRO);
// **** end autogenerated code ****
}
//Customer - Prospect Rule 2
private void GS_Customer_DataViewCustomer_CustomerTypeEqualsPRO_CustomRuleAction(Ice.Lib.ExtendedProps.RowRuleDelegateArgs args)
{
// ** RowRuleDelegateArgs Properties: args.Arg1, args.Arg2, args.Context, args.Row
// ** put custom Rule Action logic here
tbCustomerProspect.Visible = true;
tbCustomerProspect.BringToFront();
}
//Customer - Suspended Rule 2
private void CreateRowRuleGS_Customer_DataViewCustomer_CustomerTypeEquals_SUS()
{
// Description: CustomerType2
// **** begin autogenerated code ****
RuleAction[] ruleActions = new RuleAction[0];
// Create RowRule and add to the EpiDataView.
// Dummy Context Object
object contextObject = null;
RowRule rrCreateRowRuleGS_Customer_DataViewCustomer_CustomerTypeEquals_SUS = new RowRule("GS_Customer_DataView.Customer_CustomerType", RuleCondition.Equals, "SUS", new RowRuleActionDelegate2(this.GS_Customer_DataViewCustomer_CustomerTypeEqualsSUS_CustomRuleAction), contextObject);
((EpiDataView)(this.oTrans.EpiDataViews["GS_Customer_DataView"])).AddRowRule(rrCreateRowRuleGS_Customer_DataViewCustomer_CustomerTypeEquals_SUS);
// **** end autogenerated code ****
}
//Customer - Suspended Rule
private void GS_Customer_DataViewCustomer_CustomerTypeEqualsSUS_CustomRuleAction(Ice.Lib.ExtendedProps.RowRuleDelegateArgs args)
{
// ** RowRuleDelegateArgs Properties: args.Arg1, args.Arg2, args.Context, args.Row
// ** put custom Rule Action logic here
epiTextBoxC2.Visible = true;
epiTextBoxC2.BringToFront();
}
//Customer - Credit Hold Rule
private void CreateRowRuleGS_Customer_DataViewCustomer_CreditHoldEquals_True()
{
// Description: CreditHold
// **** begin autogenerated code ****
RuleAction[] ruleActions = new RuleAction[0];
// Create RowRule and add to the EpiDataView.
// Dummy Context Object
object contextObject = null;
RowRule rrCreateRowRuleGS_Customer_DataViewCustomer_CreditHoldEquals_True = new RowRule("GS_Customer_DataView.Customer_CreditHold", RuleCondition.Equals, true, new RowRuleActionDelegate2(this.GS_Customer_DataViewCustomer_CreditHoldEqualsTrue_CustomRuleAction), contextObject);
((EpiDataView)(this.oTrans.EpiDataViews["GS_Customer_DataView"])).AddRowRule(rrCreateRowRuleGS_Customer_DataViewCustomer_CreditHoldEquals_True);
// **** end autogenerated code ****
}
//Customer - Credit Hold Rule 2
private void GS_Customer_DataViewCustomer_CreditHoldEqualsTrue_CustomRuleAction(Ice.Lib.ExtendedProps.RowRuleDelegateArgs args)
{
// ** RowRuleDelegateArgs Properties: args.Arg1, args.Arg2, args.Context, args.Row
// ** put custom Rule Action logic here
tbCreditHold.Visible = true;
}
//Customer - Contact Rule
private void CreateRowRuleGS_Customer_DataViewCustomer_NoContactEquals_True()
{
// Description: NoContact
// **** begin autogenerated code ****
RuleAction[] ruleActions = new RuleAction[0];
// Create RowRule and add to the EpiDataView.
// Dummy Context Object
object contextObject = null;
RowRule rrCreateRowRuleGS_Customer_DataViewCustomer_NoContactEquals_True = new RowRule("GS_Customer_DataView.Customer_NoContact", RuleCondition.Equals, true, new RowRuleActionDelegate2(this.GS_Customer_DataViewCustomer_NoContactEqualsTrue_CustomRuleAction), contextObject);
((EpiDataView)(this.oTrans.EpiDataViews["GS_Customer_DataView"])).AddRowRule(rrCreateRowRuleGS_Customer_DataViewCustomer_NoContactEquals_True);
// **** end autogenerated code ****
}
//Customer Contact Rule 2
private void GS_Customer_DataViewCustomer_NoContactEqualsTrue_CustomRuleAction(Ice.Lib.ExtendedProps.RowRuleDelegateArgs args)
{
tbNoContact.Visible = true;
}
//Customer - Quick Note Launch Button - Popup Window
private void btnQuickNoteLaunch_Click(object sender, System.EventArgs args)
{
System.Diagnostics.Process.Start("http://envisionpp/erpdashboard/quickNoteStart.asp?custnum=" + tbCustomerCustNum.Text);
}
//**********************Order Section Code Begins*********
//Order - Order Data View
private void CreateOrderBAQView()
{
//MessageBox.Show("OrderBAQView");
GS_Order_Detail_DataView = new BAQDataView("GS_Order_Detail_DataView");
oTrans.Add("GS_Order_Detail_DataView", GS_Order_Detail_DataView);
var OrderNum = "GS_Order_Detail_DataView.OrderNum";
var OrderLine = "GS_Order_Detail_DataView.OrderLine";
oTrans.PublishColumnChange(OrderNum, Guid.NewGuid().ToString());
oTrans.PublishColumnChange(OrderLine, Guid.NewGuid().ToString());
var OrderNumPub = oTrans.GetPublisher(OrderNum);
var OrderLinePub = oTrans.GetPublisher(OrderLine);
GS_Order_Detail_DataView.SubscribeToPublisher(OrderNumPub.PublishName, "OrderDtl_OrderNum");
GS_Order_Detail_DataView.SubscribeToPublisher(OrderLinePub.PublishName, "OrderDtl_OrderLine");
}
//Order - Order NotesData View
private void CreateOrderNotesBAQView()
{
MessageBox.Show("Order Notes BAQ View");
GS_Order_Notes = new BAQDataView("GS_Order_Notes");
oTrans.Add("GS_Order_Notes", GS_Order_Notes);
var OrderNum = "MyCustomOrderView.OrderNum";
oTrans.PublishColumnChange(OrderNum, Guid.NewGuid().ToString());
var OrderNumPub = oTrans.GetPublisher(OrderNum);
GS_Order_Notes.SubscribeToPublisher(OrderNumPub.PublishName, "CRMCall_Key1");
}
//Order - Make DataView for Publishing
private void OrderPublisherView()
{
//MessageBox.Show("OrderPublisherView");
DataTable dt1 = new DataTable();
dt1.Columns.Add(new DataColumn("OrderNum",typeof(string)));
dt1.Columns.Add(new DataColumn("OrderLine", typeof(string)));
dt1.Columns.Add(new DataColumn("OrderPONum", typeof(string)));
dt1.Columns.Add(new DataColumn("SysRowID",typeof(Guid)));
var r = dt1.NewRow();
dt1.Rows.Add(r);
EpiDataView edvMyCustomOrderDV = new EpiDataView();
edvMyCustomOrderDV.dataView = dt1.DefaultView;
oTrans.Add("MyCustomOrderView",edvMyCustomOrderDV);
}
//Order - Button Search for Sales Order Number in Orders Section
private void btn_SalesOrderSearch_Click(object sender, System.EventArgs args)
{
SearchOnSalesOrderAdapterShowDialog();
}
//Order - Method for Sales Order Search in Orders Section
private void SearchOnSalesOrderAdapterShowDialog()
{
//Wizard Generated Search Method
//You will need to call this method from another method in custom code
//For example, [Form]_Load or [Button]_Click
bool recSelected;
string whereClause = string.Empty;
System.Data.DataSet dsSalesOrderAdapter = Ice.UI.FormFunctions.SearchFunctions.listLookup(this.oTrans, "SalesOrderAdapter", out recSelected, true, whereClause);
if (recSelected)
{
System.Data.DataRow adapterRow = dsSalesOrderAdapter.Tables[0].Rows[0];
tbOrderOrderNumRef.Text = adapterRow["OrderNum"].ToString();
tbOrderLineRef.Text = "1";
tbOrderPONumRef.Text = adapterRow["PONum"].ToString();
var myCustomDV = oTrans.Factory("MyCustomOrderView");
myCustomDV.dataView[myCustomDV.Row].BeginEdit();
myCustomDV.dataView[myCustomDV.Row]["OrderNum"] = tbOrderOrderNumRef.Text;
myCustomDV.dataView[myCustomDV.Row].EndEdit();
changeordernumber();
}
}
//Order - On Leave Refreshes the View and Grids
private void tbOrderOrderNumRef_Leave(object sender, System.EventArgs args)
{
//MessageBox.Show("OrderNumLeave");
if (tbOrderOrderNumRef.Text == ("0"))
{
}
else
{
tbOrderPONumRef.Text = string.Empty;
tbOrderLineRef.Text = ("1");
changeordernumber();
tbOrderPONumRef.Text = tbOrderPONum.Text;
}
}
//Order - Lines and Copy Grid Refreshes Boxes //Populate Boxes with Active Line Selection from Grid
private void gridLinesCopyChanges_AfterRowActivate(object sender, System.EventArgs args)
{
UltraGridRow activeRow = gridLinesCopyChanges.ActiveRow;
tbOrderLineRef.Text = activeRow.Cells["OrderDtl_OrderLine"].Value.ToString();
var myCustomDV = oTrans.Factory("MyCustomOrderView");
myCustomDV.dataView[myCustomDV.Row].BeginEdit();
myCustomDV.dataView[myCustomDV.Row]["OrderNum"] = tbOrderOrderNumRef.Text;
myCustomDV.dataView[myCustomDV.Row]["OrderLine"] = tbOrderLineRef.Text;
myCustomDV.dataView[myCustomDV.Row].EndEdit();
}
//Order - Lines and Copy Grid Refreshes List and Results
private void gridLinesCopyChanges_AfterSelectChange(object sender, Infragistics.Win.UltraWinGrid.AfterSelectChangeEventArgs args)
{
OrderLinesSecondRefresh();
}
//Order - Lines and Copy 2nd Refresh
private void OrderLinesSecondRefresh()
{
var myCustomDV = oTrans.Factory("MyCustomOrderView");
myCustomDV.dataView[myCustomDV.Row].BeginEdit();
myCustomDV.dataView[myCustomDV.Row]["OrderNum"] = tbOrderOrderNumRef.Text;
myCustomDV.dataView[myCustomDV.Row]["OrderLine"] = tbOrderLineRef.Text;
myCustomDV.dataView[myCustomDV.Row].EndEdit();
changeordernumber();
}
//Order - PONum Leave
private void tbOrderPONumRef_Leave(object sender, System.EventArgs args)
{
//MessageBox.Show("PONumLeave");
if (tbOrderPONumRef.Text.Length >= 3)
{
tbOrderOrderNumRef.Text = string.Empty;
tbOrderLineRef.Text = "1";
//Order Details Grid with PO
DynamicQueryAdapter dqa = new DynamicQueryAdapter(oTrans);
dqa.BOConnect();
QueryExecutionDataSet qeds = dqa.GetQueryExecutionParametersByID("GS_Order_Detail_ParamsPO");
qeds.ExecutionParameter.Clear();
qeds.ExecutionParameter.AddExecutionParameterRow("POParam", tbOrderPONumRef.Text, "nvarchar", false, Guid.NewGuid(), "A");
dqa.ExecuteByID("GS_Order_Detail_ParamsPO", qeds);
gridPOResults.DataSource = dqa.QueryResults.Tables["Results"];
{
if (dqa.QueryResults.Tables["Results"].Rows.Count <= 1)
{
gridPOResults.Visible = false;
}
else
{
MessageBox.Show("Select the PO you are searching for.");
gridPOResults.Visible = true;
gridPOResults.BringToFront();
gridPOResults.Focus();
}
}
changeordernumber();
}
else
{
}
}
//Order - PO Grid Refreshes Boxes //Populate Boxes with Active PO Selection from Grid
private void gridPOResults_AfterRowActivate(object sender, System.EventArgs args)
{
UltraGridRow activeRow = gridPOResults.ActiveRow;
tbOrderPONumRef.Text = activeRow.Cells["OrderHed_PONum"].Value.ToString();
tbOrderOrderNumRef.Text = activeRow.Cells["OrderDtl_OrderNum"].Value.ToString();
tbOrderLineRef.Text = activeRow.Cells["OrderDtl_OrderLine"].Value.ToString();
}
//Order - PO Grid Refreshes List and Results
private void gridPOResults_AfterSelectChange(object sender, Infragistics.Win.UltraWinGrid.AfterSelectChangeEventArgs args)
{
POSecondRefresh();
}
//Order - PO Grid 2nd Refresh
private void POSecondRefresh()
{
gridPOResults.Visible = false;
changeordernumber();
}
//Order - Refreshes Order View and Populates Grids //Populate Order Number and PO Number Boxes
private void changeordernumber()
{
//MessageBox.Show("ChangeOrderNumber");
tbOrderCancelled.Visible = false;
tbLineCancelled.Visible = false;
tbOrderOnHold.Visible = false;
tbOrderEditCompleted.Visible = false;
//Order Lines
DynamicQueryAdapter dqa = new DynamicQueryAdapter(oTrans);
dqa.BOConnect();
QueryExecutionDataSet qeds = dqa.GetQueryExecutionParametersByID("GS_Orders_Lines");
qeds.ExecutionParameter.Clear();
qeds.ExecutionParameter.AddExecutionParameterRow("OrderNum", tbOrderOrderNumRef.Text , "nvarchar", false, Guid.NewGuid(), "A");
dqa.ExecuteByID("GS_Orders_Lines", qeds);
gridLinesCopyChanges.DataSource = dqa.QueryResults.Tables["Results"];
//Order Checklist
DynamicQueryAdapter dqa2 = new DynamicQueryAdapter(oTrans);
dqa2.BOConnect();
QueryExecutionDataSet qeds2 = dqa2.GetQueryExecutionParametersByID("GS_Order_Checklists");
qeds2.ExecutionParameter.Clear();
qeds2.ExecutionParameter.AddExecutionParameterRow("OrderNum", tbOrderOrderNumRef.Text , "nvarchar", false, Guid.NewGuid(), "C");
qeds2.ExecutionParameter.AddExecutionParameterRow("OrderLine", tbOrderLineRef.Text, "nvarchar", false, Guid.NewGuid(), "C");
dqa2.ExecuteByID("GS_Order_Checklists", qeds2);
gridChecklist.DataSource = dqa2.QueryResults.Tables["Results"];
{
if (dqa2.QueryResults.Tables["Results"].Rows.Count > 0)
{
btnChecklist.Visible = true;
epiTextBoxNoChecklist.Visible = false;
gridChecklist.Visible = true;
tbChecklistStatus.Visible = true;
foreach (System.Data.DataRow w in dqa2.QueryResults.Tables["Results"].Rows)
{
tbChecklistStatus.Text = w["WorkFlowStatus_WFStatusName"].ToString();
}
}
else
{
tbChecklistStatus.Visible = false;
btnChecklist.Visible = false;
epiTextBoxNoChecklist.Visible = true;
gridChecklist.Visible = false;
}
}
//Order Attachments
DynamicQueryAdapter dqa7 = new DynamicQueryAdapter(oTrans);
dqa7.BOConnect();
QueryExecutionDataSet qeds7 = dqa7.GetQueryExecutionParametersByID("GS_Attachments");
qeds7.ExecutionParameter.Clear();
qeds7.ExecutionParameter.AddExecutionParameterRow("OrderNum", tbOrderOrderNumRef.Text , "nvarchar", false, Guid.NewGuid(), "F");
dqa7.ExecuteByID("GS_Attachments", qeds7);
grid_Attachments.DataSource = dqa7.QueryResults.Tables["Results"];
{
string urltodisplay = "";
foreach (System.Data.DataRow u in dqa7.QueryResults.Tables["Results"].Rows)
{if (u["XFileRef_XFileDesc"].ToString() == ("Line 01")) //Change once Attachments gets updated by Nick Knipp
{urltodisplay = u["XFileRef_XFileName"].ToString(); }
else
{}
if (urltodisplay != "")
{epiTextBoxLineArt.Text = urltodisplay;}
else
{epiTextBoxLineArt.Text = string.Empty;}
}
}
//Order Attachments Grid
{
if (dqa7.QueryResults.Tables["Results"].Rows.Count >= 1)
{
}
else
{
epiTextBoxLineArt.Text = string.Empty;
epiTextBoxOrderNoAttach.Text = string.Empty;
}
}
wbSite.Navigate (epiTextBoxLineArt.Text); //Attachment View
//Order Releases
DynamicQueryAdapter dqa8 = new DynamicQueryAdapter(oTrans);
dqa8.BOConnect();
QueryExecutionDataSet qeds8 = dqa8.GetQueryExecutionParametersByID("GS_Orders_Releases");
qeds8.ExecutionParameter.Clear();
qeds8.ExecutionParameter.AddExecutionParameterRow("OrderNum", tbOrderOrderNumRef.Text , "nvarchar", false, Guid.NewGuid(), "G");
qeds8.ExecutionParameter.AddExecutionParameterRow("OrderLine", tbOrderLineRef.Text , "nvarchar", false, Guid.NewGuid(), "G");
dqa8.ExecuteByID("GS_Orders_Releases", qeds8);
gridCopyChanges.DataSource = dqa8.QueryResults.Tables["Results"];
//Order - Row Rules
CreateRowRuleGS_Order_WorkflowWorkFlowStatus_WFStatusNameContains_New();;
CreateRowRuleGS_UD09_Movement_DataViewUD091_ShortChar04Equals_99();;
CreateRowRuleGS_Order_InvoiceInvcHead_InvoiceRefEquals_LEGACYXX();;
CreateRowRuleGS_Order_Detail_DataViewCalculated_OrderHeldEquals_True();;
CreateRowRuleGS_Order_Detail_DataViewCalculated_LineVoidedEquals_True();;
CreateRowRuleGS_Order_Detail_DataViewOrderHed_GS_EditComplete_cEquals_True();;
//Order - Websites and Images
wbSite5.DocumentText = tbInvoiceLetterPreview.Text.ToString();
wbSite2.Navigate (epiTextBoxOrderNoAttach.Text);
refreshBasicImage();
CreateRowRuleGS_Order_Detail_DataViewCalculated_InvoicedEquals_Yes();;
CreateRowRuleGS_Order_Detail_DataViewCalculated_InvoicedEquals_No();;
this.tbOrderLineRef.GotFocus += new System.EventHandler(this.tbOrderLineRef_GotFocus);
}
//Order - Size Dimension
private void refreshBasicImage()
{
string fname1 = tbOrderImageSize.Text;
if (fname1 == "")
{
}
else
{
pbSizeLayout.Image=System.Drawing.Image.FromFile(@"\\Intranet\Art\"+fname1); //Turning this off in Playpen - because it is erroring out.
}
}
//Order - Not Shipped
//Order - Attachments
private void SetupBrowser_Attachments()
{
wbSite = new System.Windows.Forms.WebBrowser();
wbSite.Dock = System.Windows.Forms.DockStyle.Fill;
wbSite.Location = new System.Drawing.Point(0,0);
wbSite.MinimumSize = new System.Drawing.Size(20,20);
wbSite.Name = "Attachments";
wbSite.Size = new System.Drawing.Size(560,323);
wbSite.TabIndex = 0;
epiGroupBoxAttachments.Controls.Add(wbSite);
}
//Order - Checklist Queue
private void SetupBrowser_ChecklistQueue()
{
wbSite3 = new System.Windows.Forms.WebBrowser();
wbSite3.Dock = System.Windows.Forms.DockStyle.Fill;
wbSite3.Location = new System.Drawing.Point(0,0);
wbSite3.MinimumSize = new System.Drawing.Size(20,20);
wbSite3.Name = "Checklist Queue";
wbSite3.Size = new System.Drawing.Size(560,323);
wbSite3.TabIndex = 0;
epiGroupBoxChecklistQueue.Controls.Add(wbSite3);
wbSite3.Navigate ("http://envisionpp/workflowqueues/checklistview.asp");
}
//Order - enFlow Queue
private void SetupBrowser_enFlowQueue()
{
wbSite6 = new System.Windows.Forms.WebBrowser();
wbSite6.Dock = System.Windows.Forms.DockStyle.Fill;
wbSite6.Location = new System.Drawing.Point(0,0);
wbSite6.MinimumSize = new System.Drawing.Size(20,20);
wbSite6.Name = "enFlow Queue";
wbSite6.Size = new System.Drawing.Size(560,323);
wbSite6.TabIndex = 0;
epiGroupBoxEnflow.Controls.Add(wbSite6);
wbSite6.Navigate ("http://envisionpp/workflow/enflowview.asp");
}
//Order Focus on Sheet
private void tbOrderLineRef_GotFocus(object sender, System.EventArgs args)
{
this.tbOrderLineRef.GotFocus += new System.EventHandler(this.tbOrderLineRef_GotFocus);
}
//Order - Quote From ORDER in Orders Section
private void btn_QuoteFromOrder_Click(object sender, System.EventArgs args)
{
LaunchFormOptions lfo = new LaunchFormOptions();
lfo.IsModal = false;
lfo.SuppressFormSearch = true;
System.Collections.Generic.Dictionary<string, string> mylist = new System.Collections.Generic.Dictionary<string, string>();
MessageBox.Show(tbOrderPart.Text + tbOrderQTY.Text + tbOrderCustID.Text + tbOrderNumColors.Text + tbOrderOrderNum.Text + tbOrderLineRef.Text);
mylist.Add("entitynum", "0");
neworderpartnum = tbOrderPart.Text;
mylist.Add("partnum", neworderpartnum);
neworderqty = tbOrderQTY.Text;
mylist.Add("quantity", neworderqty);
ordercustid = tbOrderCustID.Text;
mylist.Add("custid", ordercustid);
mylist.Add("quantitybreaks", "3");
ordernumcolors = tbOrderNumColors.Text;
mylist.Add("numofcolors", ordernumcolors);
newordernum = tbOrderOrderNum.Text;
mylist.Add("prevorder", newordernum);
neworderline = tbOrderLineRef.Text;
mylist.Add("prevorderline", neworderline);
mylist.Add("actiontype", "NewQuote");
string valuein = "Quote";
lfo.ValueIn = valuein;
lfo.ContextValue = mylist;
ProcessCaller.LaunchForm(oTrans, "GSCONFIG", lfo);
}
//Order - Create Non-Conformance *************************************************************************FIX
private void btnCreateNon_Conformance_Click(object sender, System.EventArgs args)
{
LaunchFormOptions lfo = new LaunchFormOptions();
lfo.IsModal = false;
lfo.SuppressFormSearch = true;
System.Collections.Generic.Dictionary<string, string> mylist = new System.Collections.Generic.Dictionary<string, string>();
mylist.Add("OpenRMA", "true");
mylist.Add("CustNum", "24989");
mylist.Add("RMANum", "0");
mylist.Add("OrderNum", "1411");
mylist.Add("OrderLine", "1");
mylist.Add("OrderRel", "1");
mylist.Add("actiontype", "NewRMA");
lfo.ValueIn = mylist;
ProcessCaller.LaunchForm(oTrans, "CRGO5000", lfo);
}
//Order - View Order in Configurator - Button hidden - Janice hasn't made Call for this yet.
private void btnOrderView_Click(object sender, System.EventArgs args)
{
LaunchFormOptions lfo = new LaunchFormOptions();
string valuein = "Order";
newordernum = tbOrderOrderNumRef.Text;
string contextvaluein = newordernum.ToString();
lfo.ValueIn = valuein;
lfo.ContextValue = contextvaluein;
ProcessCaller.LaunchForm(oTrans, "GSCONFIG", lfo);
}
//Launch Epicor URL - Any Area
private void LaunchURL(string url, string title = "", int padding = 65)
{
Ice.Lib.Customization.CustomWebBrowserDialog uiWebBrowser = new Ice.Lib.Customization.CustomWebBrowserDialog();
Ice.Lib.Framework.EpiBaseForm f = (Ice.Lib.Framework.EpiBaseForm)csm.PersonalizeCustomizeManager.TopControl.FindForm();
uiWebBrowser.Width = f.Width - padding;
uiWebBrowser.Height = f.Height - padding;
uiWebBrowser.Text = title;
uiWebBrowser.HomeURL = url;
uiWebBrowser.StartPosition = FormStartPosition.CenterScreen; // If you don't center you can use .Top and .Left
uiWebBrowser.Show();
uiWebBrowser.OnRefresh(); // Loads URL
}
//Order - Attachments in Grid
private void SetupBrowser_AttachmentListView()
{
wbSite2 = new System.Windows.Forms.WebBrowser();
wbSite2.Dock = System.Windows.Forms.DockStyle.Fill;
wbSite2.Location = new System.Drawing.Point(0,0);
wbSite2.MinimumSize = new System.Drawing.Size(20,20);
wbSite2.Name = "Attachment List View";
wbSite2.Size = new System.Drawing.Size(560,323);
wbSite2.TabIndex = 0;
epiGroupBoxAttachmentsGridView.Controls.Add(wbSite2);
}
//Order - Shipstore Button URL Launch
private void btnShipstore_Click(object sender, System.EventArgs args)
{
System.Diagnostics.Process.Start("http://shipstore.gill-line.com/Prod/");
}
//Order - enFlow Button URL Launch
private void btn_enFlow_Click(object sender, System.EventArgs args)
{
System.Diagnostics.Process.Start("http://envisionpp/workflow/enflowview.asp?ordernum=" + tbOrderOrderNumRef.Text + "&nohead=Y");
}
//Order - Order Change Shipping Button URL Launch
private void btnChangeShipping_Click(object sender, System.EventArgs args)
{
System.Diagnostics.Process.Start("http://envisionpp/workflow/workflow.asp?wftypeid=18&nohead=Y&ischild=Y&ordernum=" + tbOrderOrderNumRef.Text);
}
//Order - Quick Notes
private void btnOrderQuickNotes_Click(object sender, System.EventArgs args)
{
System.Diagnostics.Process.Start("http://envisionpp/erpdashboard/quickNoteStart.asp?order=" + tbOrderOrderNumRef.Text + "&line=" + tbOrderLineRef.Text);
}
//Order - Expediting Button URL Launch
private void btnExpediting_Click(object sender, System.EventArgs args)
{
System.Diagnostics.Process.Start("http://envisionpp/workflow/workflow.asp?wftypeid=6&nohead=Y&ischild=Y&ordernum=" + tbOrderOrderNumRef.Text + "&orderline=" + tbOrderLineRef.Text);
}
//Order - Checklist
private void btnChecklist_Click(object sender, System.EventArgs args)
{
System.Diagnostics.Process.Start("http://envisionpp/workflow/workflow.asp?nohead=y&wftypeid=2&ordernum=" + tbOrderOrderNumRef.Text + "&orderline=" + tbOrderLineRef.Text);
}
//Order - Attachments Grid Displays File
private void grid_Attachments_AfterRowActivate(object sender, System.EventArgs args)
{
UltraGridRow activeRow = grid_Attachments.ActiveRow;
epiTextBoxOrderNoAttach.Text = activeRow.Cells["XFileRef_XFileName"].Value.ToString();
if (epiTextBoxOrderNoAttach.Text.StartsWith("http://viewit"))
{
wbSite2.Navigate ("http://viewit");
//MessageBox.Show("View It File - This will refresh");
//wbSite2.Refresh();
wbSite2.Navigate (epiTextBoxOrderNoAttach.Text);
}
else
{
wbSite2.Navigate (epiTextBoxOrderNoAttach.Text);
}
}
//Order - Movement Data View
private void CreateMovementBAQView()
{
//MessageBox.Show("MovementBAQ");
GS_UD09_Movement_DataView = new BAQDataView("GS_UD09_Movement_DataView");
oTrans.Add("GS_UD09_Movement_DataView", GS_UD09_Movement_DataView);
var OrderNum = "MyCustomOrderView.OrderNum";
var OrderLine = "MyCustomOrderView.OrderLine";
oTrans.PublishColumnChange(OrderNum, Guid.NewGuid().ToString());
oTrans.PublishColumnChange(OrderLine, Guid.NewGuid().ToString());
var OrderNumPub = oTrans.GetPublisher(OrderNum);
var OrderLinePub = oTrans.GetPublisher(OrderLine);
GS_UD09_Movement_DataView.SubscribeToPublisher(OrderNumPub.PublishName, "UD091_Number01");
GS_UD09_Movement_DataView.SubscribeToPublisher(OrderLinePub.PublishName, "UD091_Number02");
}
//Order - Invoice Data View
private void CreateInvoiceBAQView()
{
//MessageBox.Show("InvoiceBAQ");
GS_Order_Invoice_DataView = new BAQDataView("GS_Order_Invoice");
oTrans.Add("GS_Order_Invoice", GS_Order_Invoice_DataView);
var OrderNum = "MyCustomOrderView.OrderNum";
oTrans.PublishColumnChange(OrderNum, Guid.NewGuid().ToString());
var OrderNumPub = oTrans.GetPublisher(OrderNum);
GS_Order_Invoice_DataView.SubscribeToPublisher(OrderNumPub.PublishName, "InvcHead_OrderNum");
}
//Order - Workflow Data View
private void CreateWorkflowBAQView()
{
//MessageBox.Show("WorkflowBAQ");
GS_Order_Workflow_DataView = new BAQDataView("GS_Order_Workflow"); //GS_Order_Workflow
oTrans.Add("GS_Order_Workflow", GS_Order_Workflow_DataView);
var OrderNum = "MyCustomOrderView.OrderNum";
oTrans.PublishColumnChange(OrderNum, Guid.NewGuid().ToString());
var OrderNumPub = oTrans.GetPublisher(OrderNum);
GS_Order_Workflow_DataView.SubscribeToPublisher(OrderNumPub.PublishName, "WorkFlow_OrderNum");
}
//Order - Misc Charges Data View
private void CreateMiscChargesBAQView()
{
//MessageBox.Show("MiscChargesBAQ");
GS_Misc_Charges_DataView = new BAQDataView("GS_Misc_Charges"); //GS Order Misc. Charges Grid
oTrans.Add("GS_Misc_Charges", GS_Misc_Charges_DataView);
var OrderNum = "MyCustomOrderView.OrderNum";
var OrderLine = "MyCustomOrderView.OrderLine";
oTrans.PublishColumnChange(OrderNum, Guid.NewGuid().ToString());
oTrans.PublishColumnChange(OrderLine, Guid.NewGuid().ToString());
var OrderNumPub = oTrans.GetPublisher(OrderNum);
var OrderLinePub = oTrans.GetPublisher(OrderLine);
GS_Misc_Charges_DataView.SubscribeToPublisher(OrderNumPub.PublishName, "OrderMsc_OrderNum");
GS_Misc_Charges_DataView.SubscribeToPublisher(OrderLinePub.PublishName, "OrderMsc_OrderLine");
}
//Order - Invoice Letter Preview
private void CreateInvoicePreviewBAQView()
{
//MessageBox.Show("InvoiceBAQ");
GS_Invoice_LetterUD15_DataView = new BAQDataView("GS_Invoice_LetterUD15"); //GS Order Invoice Preview Letter
oTrans.Add("GS_Invoice_LetterUD15", GS_Invoice_LetterUD15_DataView);
var OrderNum = "MyCustomOrderView.OrderNum";
oTrans.PublishColumnChange(OrderNum, Guid.NewGuid().ToString());
var OrderNumPub = oTrans.GetPublisher(OrderNum);
GS_Invoice_LetterUD15_DataView.SubscribeToPublisher(OrderNumPub.PublishName, "UD15_Key3");
}
//Order - Invoice Letter Preview
public void SetupBrowser_InvoiceLetter()
{
wbSite5 = new System.Windows.Forms.WebBrowser();
wbSite5.Dock = System.Windows.Forms.DockStyle.Fill;
wbSite5.Location = new System.Drawing.Point(0,0);
wbSite5.MinimumSize = new System.Drawing.Size(20,20);
wbSite5.Name = "Invoice Letter Preview";
wbSite5.Size = new System.Drawing.Size(560,323);
wbSite5.TabIndex = 0;
tbInvoicePreviewLetter.Controls.Add(wbSite5);
}
//Order - Rule for Dept Less than 99
private void CreateRowRuleGS_UD09_Movement_DataViewUD091_ShortChar04LessThan_99()
{
// Description: HideDept99
// **** begin autogenerated code ****
RuleAction[] ruleActions = new RuleAction[0];
// Create RowRule and add to the EpiDataView.
// Dummy Context Object
object contextObject = null;
RowRule rrCreateRowRuleGS_UD09_Movement_DataViewUD091_ShortChar04LessThan_99 = new RowRule("GS_UD09_Movement_DataView.UD091_ShortChar04", RuleCondition.LessThan, 99, new RowRuleActionDelegate2(this.GS_UD09_Movement_DataViewUD091_ShortChar04LessThan99_CustomRuleAction), contextObject);
((EpiDataView)(this.oTrans.EpiDataViews["GS_UD09_Movement_DataView"])).AddRowRule(rrCreateRowRuleGS_UD09_Movement_DataViewUD091_ShortChar04LessThan_99);
// **** end autogenerated code ****
}
private void GS_UD09_Movement_DataViewUD091_ShortChar04LessThan99_CustomRuleAction(Ice.Lib.ExtendedProps.RowRuleDelegateArgs args)
{
// ** RowRuleDelegateArgs Properties: args.Arg1, args.Arg2, args.Context, args.Row
// ** put custom Rule Action logic here
btnShipstore.Visible = false;
btnCreateNon_Conformance.Visible = false;
}
//Order - Workflow Rule
private void CreateRowRuleGS_Order_WorkflowWorkFlowStatus_WFStatusNameContains_New()
{
// Description: ColorWorkflows
// **** begin autogenerated code ****
RuleAction warningGS_Order_Workflow_RowAction = RuleAction.AddRowSettings(this.oTrans, "GS_Order_Workflow", true, SettingStyle.Warning);
RuleAction[] ruleActions = new RuleAction[] {
warningGS_Order_Workflow_RowAction};
// Create RowRule and add to the EpiDataView.
RowRule rrCreateRowRuleGS_Order_WorkflowWorkFlowStatus_WFStatusNameContains_New = new RowRule("GS_Order_Workflow.WorkFlowStatus_WFStatusName", RuleCondition.Contains, "New", ruleActions);
((EpiDataView)(this.oTrans.EpiDataViews["GS_Order_Workflow"])).AddRowRule(rrCreateRowRuleGS_Order_WorkflowWorkFlowStatus_WFStatusNameContains_New);
// **** end autogenerated code ****
}
//Order - Dept 99 Rule
private void CreateRowRuleGS_UD09_Movement_DataViewUD091_ShortChar04Equals_99()
{
// Description: Dept99Hide
// **** begin autogenerated code ****
RuleAction[] ruleActions = new RuleAction[0];
// Create RowRule and add to the EpiDataView.
// Dummy Context Object
object contextObject = null;
RowRule rrCreateRowRuleGS_UD09_Movement_DataViewUD091_ShortChar04Equals_99 = new RowRule("GS_UD09_Movement_DataView.UD091_ShortChar04", RuleCondition.Equals, 99, new RowRuleActionDelegate2(this.GS_UD09_Movement_DataViewUD091_ShortChar04Equals99_CustomRuleAction), contextObject);
((EpiDataView)(this.oTrans.EpiDataViews["GS_UD09_Movement_DataView"])).AddRowRule(rrCreateRowRuleGS_UD09_Movement_DataViewUD091_ShortChar04Equals_99);
// **** end autogenerated code ****
}
private void GS_UD09_Movement_DataViewUD091_ShortChar04Equals99_CustomRuleAction(Ice.Lib.ExtendedProps.RowRuleDelegateArgs args)
{
// ** RowRuleDelegateArgs Properties: args.Arg1, args.Arg2, args.Context, args.Row
// ** put custom Rule Action logic here
btnShipstore.Visible = true;
btnCreateNon_Conformance.Visible = true;
}
//Order - Invoice Rule for Legacy
private void CreateRowRuleGS_Order_InvoiceInvcHead_InvoiceRefEquals_LEGACYXX()
{
// Description: InvoiceLegacyShow
// **** begin autogenerated code ****
RuleAction[] ruleActions = new RuleAction[0];
// Create RowRule and add to the EpiDataView.
// Dummy Context Object
object contextObject = null;
RowRule rrCreateRowRuleGS_Order_InvoiceInvcHead_InvoiceRefEquals_LEGACYXX = new RowRule("GS_Order_Invoice.InvcHead_InvoiceRef", RuleCondition.Equals, "LEGACYXX", new RowRuleActionDelegate2(this.GS_Order_InvoiceInvcHead_InvoiceRefEqualsLEGACYXX_CustomRuleAction), contextObject);
((EpiDataView)(this.oTrans.EpiDataViews["GS_Order_Invoice"])).AddRowRule(rrCreateRowRuleGS_Order_InvoiceInvcHead_InvoiceRefEquals_LEGACYXX);
// **** end autogenerated code ****
}
private void GS_Order_InvoiceInvcHead_InvoiceRefEqualsLEGACYXX_CustomRuleAction(Ice.Lib.ExtendedProps.RowRuleDelegateArgs args)
{
tbLegacyInvoice.Visible = true;
tbLegacyInvoicePreview.Visible = true;
tbLegacyInvoicePreview.BringToFront();
}
//Order - Held Order Rule
private void CreateRowRuleGS_Order_Detail_DataViewCalculated_OrderHeldEquals_True()
{
// Description: Order Held
// **** begin autogenerated code ****
RuleAction[] ruleActions = new RuleAction[0];
// Create RowRule and add to the EpiDataView.
// Dummy Context Object
object contextObject = null;
RowRule rrCreateRowRuleGS_Order_Detail_DataViewCalculated_OrderHeldEquals_True = new RowRule("GS_Order_Detail_DataView.Calculated_OrderHeld", RuleCondition.Equals, true, new RowRuleActionDelegate2(this.GS_Order_Detail_DataViewCalculated_OrderHeldEqualsTrue_CustomRuleAction), contextObject);
((EpiDataView)(this.oTrans.EpiDataViews["GS_Order_Detail_DataView"])).AddRowRule(rrCreateRowRuleGS_Order_Detail_DataViewCalculated_OrderHeldEquals_True);
// **** end autogenerated code ****
}
private void GS_Order_Detail_DataViewCalculated_OrderHeldEqualsTrue_CustomRuleAction(Ice.Lib.ExtendedProps.RowRuleDelegateArgs args)
{
// ** RowRuleDelegateArgs Properties: args.Arg1, args.Arg2, args.Context, args.Row
// ** put custom Rule Action logic here
tbOrderOnHold.Visible = true;
}
//Order - Line Cancelled Rule
private void CreateRowRuleGS_Order_Detail_DataViewCalculated_LineVoidedEquals_True()
{
// Description: Line Cancelled
// **** begin autogenerated code ****
RuleAction[] ruleActions = new RuleAction[0];
// Create RowRule and add to the EpiDataView.
// Dummy Context Object
object contextObject = null;
RowRule rrCreateRowRuleGS_Order_Detail_DataViewCalculated_LineVoidedEquals_True = new RowRule("GS_Order_Detail_DataView.Calculated_LineVoided", RuleCondition.Equals, true, new RowRuleActionDelegate2(this.GS_Order_Detail_DataViewCalculated_LineVoidedEqualsTrue_CustomRuleAction), contextObject);
((EpiDataView)(this.oTrans.EpiDataViews["GS_Order_Detail_DataView"])).AddRowRule(rrCreateRowRuleGS_Order_Detail_DataViewCalculated_LineVoidedEquals_True);
// **** end autogenerated code ****
}
private void GS_Order_Detail_DataViewCalculated_LineVoidedEqualsTrue_CustomRuleAction(Ice.Lib.ExtendedProps.RowRuleDelegateArgs args)
{
// ** RowRuleDelegateArgs Properties: args.Arg1, args.Arg2, args.Context, args.Row
// ** put custom Rule Action logic here
tbLineCancelled.Visible = true;
}
private void CreateRowRuleGS_Order_Detail_DataViewOrderHed_GS_EditComplete_cEquals_True()
{
// Description: Editing Complete
// **** begin autogenerated code ****
RuleAction[] ruleActions = new RuleAction[0];
// Create RowRule and add to the EpiDataView.
// Dummy Context Object
object contextObject = null;
RowRule rrCreateRowRuleGS_Order_Detail_DataViewOrderHed_GS_EditComplete_cEquals_True = new RowRule("GS_Order_Detail_DataView.OrderHed_GS_EditComplete_c", RuleCondition.Equals, true, new RowRuleActionDelegate2(this.GS_Order_Detail_DataViewOrderHed_GS_EditComplete_cEqualsTrue_CustomRuleAction), contextObject);
((EpiDataView)(this.oTrans.EpiDataViews["GS_Order_Detail_DataView"])).AddRowRule(rrCreateRowRuleGS_Order_Detail_DataViewOrderHed_GS_EditComplete_cEquals_True);
// **** end autogenerated code ****
}
private void GS_Order_Detail_DataViewOrderHed_GS_EditComplete_cEqualsTrue_CustomRuleAction(Ice.Lib.ExtendedProps.RowRuleDelegateArgs args)
{
// ** RowRuleDelegateArgs Properties: args.Arg1, args.Arg2, args.Context, args.Row
// ** put custom Rule Action logic here
tbOrderEditCompleted.Visible = true;
}
//Order - Order Voided Rule
private void CreateRowRuleGS_Order_Detail_DataViewCalculated_OrderVoidedEquals_True()
{
// Description: Order Cancelled
// **** begin autogenerated code ****
RuleAction[] ruleActions = new RuleAction[0];
// Create RowRule and add to the EpiDataView.
// Dummy Context Object
object contextObject = null;
RowRule rrCreateRowRuleGS_Order_Detail_DataViewCalculated_OrderVoidedEquals_True = new RowRule("GS_Order_Detail_DataView.Calculated_OrderVoided", RuleCondition.Equals, true, new RowRuleActionDelegate2(this.GS_Order_Detail_DataViewCalculated_OrderVoidedEqualsTrue_CustomRuleAction), contextObject);
((EpiDataView)(this.oTrans.EpiDataViews["GS_Order_Detail_DataView"])).AddRowRule(rrCreateRowRuleGS_Order_Detail_DataViewCalculated_OrderVoidedEquals_True);
// **** end autogenerated code ****
}
private void GS_Order_Detail_DataViewCalculated_OrderVoidedEqualsTrue_CustomRuleAction(Ice.Lib.ExtendedProps.RowRuleDelegateArgs args)
{
// ** RowRuleDelegateArgs Properties: args.Arg1, args.Arg2, args.Context, args.Row
// ** put custom Rule Action logic here
tbOrderCancelled.Visible = true;
}
//**********************QUOTE Section Code Begins **********
//Quote - Quote Data View
private void CreateQuoteBAQView()
{
MessageBox.Show("QuoteBAQ2");
GS_Quote_DataView = new BAQDataView("GS_Quote_DataView");
//MessageBox.Show("QuoteBAQ2a");
oTrans.Add("GS_Quote_DataView", GS_Quote_DataView);
//MessageBox.Show("QuoteBAQ2b");
var QuoteNum = "MyCustomQuoteView.QuoteNum";
//MessageBox.Show("QuoteBAQ2c");
oTrans.PublishColumnChange(QuoteNum, Guid.NewGuid().ToString());
//MessageBox.Show("QuoteBAQ2d");
var QuoteNumPub = oTrans.GetPublisher(QuoteNum);
MessageBox.Show("QuoteBAQ2e");
GS_Quote_DataView.SubscribeToPublisher(QuoteNumPub.PublishName, "QuoteDtl_QuoteNum");
MessageBox.Show("QuoteBAQ2f");
}
//Customer - Make DataView for Publishing
private void QuotePublisherView()
{
//MessageBox.Show("QuotePublisher");
DataTable dt3 = new DataTable();
dt3.Columns.Add(new DataColumn("QuoteNum",typeof(string)));
dt3.Columns.Add(new DataColumn("SysRowID",typeof(Guid)));
var r = dt3.NewRow();
dt3.Rows.Add(r);
EpiDataView edvMyCustomQuoteDV = new EpiDataView();
edvMyCustomQuoteDV.dataView = dt3.DefaultView;
oTrans.Add("MyCustomQuoteView",edvMyCustomQuoteDV);
}
//New Quote - Customer ID Search in the Create New Quote Section
private void btnQS_CustID_Click(object sender, System.EventArgs args)
{
SearchOnCustomerAdapterShowDialog_2();
}
//New Quote - Customer ID Search Method in the Create New Quote Section
private void SearchOnCustomerAdapterShowDialog_2()
{
//Wizard Generated Search Method
//You will need to call this method from another method in custom code
//For example, [Form]_Load or [Button]_Click
bool recSelected;
string whereClause = string.Empty;
System.Data.DataSet dsCustomerAdapter = Ice.UI.FormFunctions.SearchFunctions.listLookup(this.oTrans, "CustomerAdapter", out recSelected, true, whereClause);
if (recSelected)
{
System.Data.DataRow adapterRow = dsCustomerAdapter.Tables[0].Rows[0];
// Map Search Fields to Application Fields
{
epiTextQS_CustID.Text = adapterRow["CustID"].ToString();
DynamicQueryAdapter dqa10 = new DynamicQueryAdapter(oTrans);
dqa10.BOConnect();
QueryExecutionDataSet qeds10 = dqa10.GetQueryExecutionParametersByID("GS_Quote_Memos");
qeds10.ExecutionParameter.Clear();
qeds10.ExecutionParameter.AddExecutionParameterRow("CustID", epiTextQS_CustID.Text , "nvarchar", false, Guid.NewGuid(), "A");
dqa10.ExecuteByID("GS_Quote_Memos", qeds10);
epiUltraGridC4.DataSource = dqa10.QueryResults.Tables["Results"];
}
}
}
//New Quote - Part Search in Create New Quote Section
private void btnQS_Part_Click(object sender, System.EventArgs args)
{
SearchOnPartAdapterShowDialog_1();
}
//New Quote - Part Search Method in Create New Quote Section
private void SearchOnPartAdapterShowDialog_1()
{
//Wizard Generated Search Method
//You will need to call this method from another method in custom code
//For example, [Form]_Load or [Button]_Click
bool recSelected;
string whereClause = string.Empty;
System.Data.DataSet dsPartAdapter = Ice.UI.FormFunctions.SearchFunctions.listLookup(this.oTrans, "PartAdapter", out recSelected, true, whereClause);
if (recSelected)
{
System.Data.DataRow adapterRow = dsPartAdapter.Tables[0].Rows[0];
//Map Search Fields to Application Fields
{
epiTextQS_PartNum.Text = adapterRow["PartNum"].ToString();
}
}
}
//New Quote - New Quote - Launches Quote Configurator and Passes Information in the Create New Quote Section
private void btnQS_NewQuote_Click(object sender, System.EventArgs args)
{
LaunchFormOptions lfo = new LaunchFormOptions();
System.Collections.Generic.Dictionary<string, string> mylist = new System.Collections.Generic.Dictionary<string, string>();
newcustid = epiTextQS_CustID.Text;
mylist.Add("custid", newcustid.ToString());
newquoteqty = Convert.ToInt32(epiNumericQS_Qty.Text);
mylist.Add("quantity", newquoteqty.ToString());
newquotepartnum = epiTextQS_PartNum.Text;
mylist.Add("partnum", newquotepartnum);
newnumcolors = Convert.ToInt32(epiNumericQS_NumColors.Text);
mylist.Add("numofcolors", newnumcolors.ToString());
newqtybreaks = Convert.ToInt32(epiNumericQtyBreaks.Text);
mylist.Add("quantitybreaks", newqtybreaks.ToString());
enflowID = tbQuoteAttachments.Text;
mylist.Add("enflow", enflowID.ToString());
mylist.Add("actiontype", "NewQuote");
mylist.Add("entitynum", "0");
string valuein = "Quote";
lfo.ValueIn = valuein;
lfo.ContextValue = mylist;
ProcessCaller.LaunchForm(oTrans, "GSCONFIG", lfo);
}
//Quote Search in Quote Tracker Section
private void btn_QS_Num1_Click(object sender, System.EventArgs args)
{
SearchOnQuoteAdapterShowDialog_1();
}
//Quote Search in Quote Tracker Section
private void SearchOnQuoteAdapterShowDialog_1()
{
//Wizard Generated Search Method
//You will need to call this method from another method in custom code
//For example, [Form]_Load or [Button]_Click
bool recSelected;
string whereClause = string.Empty;
System.Data.DataSet dsQuoteAdapter = Ice.UI.FormFunctions.SearchFunctions.listLookup(this.oTrans, "QuoteAdapter", out recSelected, true, whereClause);
if (recSelected)
{
System.Data.DataRow adapterRow = dsQuoteAdapter.Tables[0].Rows[0];
// Map Search Fields to Application Fields
tbQuoteNumberReference.Text = adapterRow["QuoteNum"].ToString();
changequotenumber();
}
}
//Quote - Edit Quote in Quote Tracker Section FIX
private void btn_QS_editquo1_Click(object sender, System.EventArgs args)
{
LaunchFormOptions lfo = new LaunchFormOptions();
string valuein = "Quote";
quotenum = tbQuoteNumberReference.Text;
string contextvaluein = quotenum;
lfo.ValueIn = valuein;
lfo.ContextValue = contextvaluein;
ProcessCaller.LaunchForm(oTrans, "GSCONFIG", lfo);
}
//Quote - On Quote Customer ID Leave of Field execute Dynamic Query to Populate Quote Memos by Customer
private void epiTextQS_CustID_Leave(object sender, System.EventArgs args)
{
MessageBox.Show("CustID Leave");
DynamicQueryAdapter dqa10 = new DynamicQueryAdapter(oTrans);
dqa10.BOConnect();
QueryExecutionDataSet qeds10 = dqa10.GetQueryExecutionParametersByID("GS_Quote_Memos");
qeds10.ExecutionParameter.Clear();
qeds10.ExecutionParameter.AddExecutionParameterRow("CustID", epiTextQS_CustID.Text , "nvarchar", false, Guid.NewGuid(), "A");
dqa10.ExecuteByID("GS_Quote_Memos", qeds10);
epiUltraGridC4.DataSource = dqa10.QueryResults.Tables["Results"];
}
//Quote - Refreshes Quote View
private void changequotenumber()
{
MessageBox.Show("ChangeQuoteNumber");
DynamicQueryAdapter dqa1 = new DynamicQueryAdapter(oTrans);
dqa1.BOConnect();
QueryExecutionDataSet qeds1 = dqa1.GetQueryExecutionParametersByID("GS_Quote_LetterUD15");
qeds1.ExecutionParameter.Clear();
qeds1.ExecutionParameter.AddExecutionParameterRow("QuoteNum", tbQuoteNumberReference.Text, "nvarchar", false, Guid.NewGuid(), "C");
dqa1.ExecuteByID("GS_Quote_LetterUD15", qeds1);
grid_QuoteLetterPrev.DataSource = dqa1.QueryResults.Tables["Results"];
foreach (System.Data.DataRow r in dqa1.QueryResults.Tables["Results"].Rows)
{
epiTextBoxQuoteLetterHTML.Text = r["UD15_GS_BodyEmail_c"].ToString();
epiTextBoxQuoteLetterTo.Text = r["UD15_GS_ToEmail_c"].ToString();
epiDateTimeEditorQuoteLetterSentDate.Text = r["UD15_GS_SentTime_c"].ToString();
txtQuoteSentDate.Text = epiDateTimeEditorQuoteLetterSentDate.Text;
}
wbSite4.DocumentText = epiTextBoxQuoteLetterHTML.Text.ToString();
{
if (tbLegacyRef.Text == "LEGACYXX")
{
LegacyIndicatorLabel.Visible = true;
tbQuoteComment.Visible = true;
tbQuoteLegacyRef2.Visible = true;
}
else
{
LegacyIndicatorLabel.Visible = false;
tbQuoteComment.Visible = false;
tbQuoteLegacyRef2.Visible = false;
}
}
}
//Quote - Quote Letter Preview
public void SetupBrowser_QuoteLetter()
{
wbSite4 = new System.Windows.Forms.WebBrowser();
wbSite4.Dock = System.Windows.Forms.DockStyle.Fill;
wbSite4.Location = new System.Drawing.Point(0,0);
wbSite4.MinimumSize = new System.Drawing.Size(20,20);
wbSite4.Name = "Quote Letter Preview";
wbSite4.Size = new System.Drawing.Size(560,323);
wbSite4.TabIndex = 0;
epiGroupBoxQuoteLetterPrev.Controls.Add(wbSite4);
}
//Quote - Calls the View Update on Leave
private void tbQuoteNumberReference_Leave(object sender, System.EventArgs args)
{
MessageBox.Show("QuoteRefLeave");
changequotenumber();
}
//Quote - Button to Clear New Quote Fields
private void btnQuoteClearForm_Click(object sender, System.EventArgs args)
{
epiTextQS_CustID.Text = string.Empty;
DynamicQueryAdapter dqa10 = new DynamicQueryAdapter(oTrans);
dqa10.BOConnect();
QueryExecutionDataSet qeds10 = dqa10.GetQueryExecutionParametersByID("GS_Quote_Memos");
qeds10.ExecutionParameter.Clear();
qeds10.ExecutionParameter.AddExecutionParameterRow("CustID", epiTextQS_CustID.Text , "nvarchar", false, Guid.NewGuid(), "A");
dqa10.ExecuteByID("GS_Quote_Memos", qeds10);
epiUltraGridC4.DataSource = dqa10.QueryResults.Tables["Results"];
epiTextQS_PartNum.Text = string.Empty;
epiNumericQS_Qty.Value = "0";
epiNumericQS_NumColors.Value = "0";
epiNumericQtyBreaks.Value = "0";
tbQuoteAttachments.Text = string.Empty;
}
//All - Clear View
private void ClearScreen()
{
MessageBox.Show("Clear Screen");
epiTextQS_PartNum.Text = string.Empty;
epiTextQS_CustID.Text = "0";
tbQuoteNumberReference.Text = "0";
epiNumericQS_Qty.Value = "0";
epiNumericQS_NumColors.Value = "0";
epiNumericQtyBreaks.Value = "0";
tbQuoteAttachments.Text = string.Empty;
epiTextBoxLineArt.Text = string.Empty;
epiTextBoxOrderNoAttach.Text = string.Empty;
tbCustomerIDRef.Text = string.Empty;
tbOrderOrderNumRef.Text = "0";
tbOrderLineRef.Text = "0";
tbOrderPONumRef.Text = string.Empty;
txtQuoteSentDate.Text = string.Empty;
epiTextBoxQuoteLetterTo.Text = string.Empty;
epiTextBoxQuoteLetterHTML.Text = string.Empty;
LegacyIndicatorLabel.Visible = false;
tbQuoteComment.Visible = false;
tbQuoteLegacyRef2.Visible = false;
tbOrderHasShipped.Visible = false;
tbOrderHasNotShipped.Visible = false;
btnShipstore.Visible = true;
btnChecklist.Visible = true;
btnCreateNon_Conformance.Visible = true;
var myCustomDV = oTrans.Factory("MyCustomView");
myCustomDV.dataView[myCustomDV.Row].BeginEdit();
myCustomDV.dataView[myCustomDV.Row]["CustID"] = tbCustomerIDRef.Text;
myCustomDV.dataView[myCustomDV.Row].EndEdit();
var myCustomOrderDV = oTrans.Factory("MyCustomOrderView");
myCustomOrderDV.dataView[myCustomOrderDV.Row].BeginEdit();
myCustomOrderDV.dataView[myCustomOrderDV.Row]["OrderNum"] = tbOrderOrderNumRef.Text;
myCustomOrderDV.dataView[myCustomOrderDV.Row]["OrderLine"] = tbOrderLineRef.Text;
myCustomOrderDV.dataView[myCustomOrderDV.Row].EndEdit();
var myCustomQuoteDV = oTrans.Factory("MyCustomQuoteView");
myCustomQuoteDV.dataView[myCustomQuoteDV.Row].BeginEdit();
myCustomQuoteDV.dataView[myCustomQuoteDV.Row]["QuoteNum"] = tbQuoteNumberReference.Text;
myCustomQuoteDV.dataView[myCustomQuoteDV.Row].EndEdit();
changeordernumber();
changecustomernumber();
changequotenumber();
tbCustomerIDRef.Focus();
}
//All - Clear View
private void RefreshScreen()
{
MessageBox.Show("Refresh");
LegacyIndicatorLabel.Visible = false;
tbQuoteComment.Visible = false;
tbQuoteLegacyRef2.Visible = false;
tbOrderHasShipped.Visible = false;
tbOrderHasNotShipped.Visible = false;
btnShipstore.Visible = true;
btnChecklist.Visible = true;
btnCreateNon_Conformance.Visible = true;
var myCustomDV = oTrans.Factory("MyCustomView");
myCustomDV.dataView[myCustomDV.Row].BeginEdit();
myCustomDV.dataView[myCustomDV.Row]["CustID"] = tbCustomerIDRef.Text;
myCustomDV.dataView[myCustomDV.Row].EndEdit();
var myCustomOrderDV = oTrans.Factory("MyCustomOrderView");
myCustomOrderDV.dataView[myCustomOrderDV.Row].BeginEdit();
myCustomOrderDV.dataView[myCustomOrderDV.Row]["OrderNum"] = tbOrderOrderNumRef.Text;
myCustomOrderDV.dataView[myCustomOrderDV.Row]["OrderLine"] = tbOrderLineRef.Text;
myCustomOrderDV.dataView[myCustomOrderDV.Row].EndEdit();
var myCustomQuoteDV = oTrans.Factory("MyCustomQuoteView");
myCustomQuoteDV.dataView[myCustomQuoteDV.Row].BeginEdit();
myCustomQuoteDV.dataView[myCustomQuoteDV.Row]["QuoteNum"] = tbQuoteNumberReference.Text;
myCustomQuoteDV.dataView[myCustomQuoteDV.Row].EndEdit();
changeordernumber();
changecustomernumber();
changequotenumber();
}
//All Clear Screen Tool
private void baseToolbarsManager_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs args)
{
switch (args.Tool.Key)
{
case "ClearTool":
ClearScreen();
break;
case "RefreshTool":
RefreshScreen();
break;
}
}
private void CreateRowRuleGS_Order_Detail_DataViewCalculated_InvoicedEquals_Yes()
{
MessageBox.Show("Row Rule Order Detail Invoiced");
// Description: ShippedOrder
// **** begin autogenerated code ****
RuleAction[] ruleActions = new RuleAction[0];
// Create RowRule and add to the EpiDataView.
// Dummy Context Object
object contextObject = null;
RowRule rrCreateRowRuleGS_Order_Detail_DataViewCalculated_InvoicedEquals_Yes = new RowRule("GS_Order_Detail_DataView.Calculated_Invoiced", RuleCondition.Equals, "Yes", new RowRuleActionDelegate2(this.GS_Order_Detail_DataViewCalculated_InvoicedEqualsYes_CustomRuleAction), contextObject);
((EpiDataView)(this.oTrans.EpiDataViews["GS_Order_Detail_DataView"])).AddRowRule(rrCreateRowRuleGS_Order_Detail_DataViewCalculated_InvoicedEquals_Yes);
// **** end autogenerated code ****
}
private void GS_Order_Detail_DataViewCalculated_InvoicedEqualsYes_CustomRuleAction(Ice.Lib.ExtendedProps.RowRuleDelegateArgs args)
{
MessageBox.Show("Row Rule Order Detail Invoiced2");
// ** RowRuleDelegateArgs Properties: args.Arg1, args.Arg2, args.Context, args.Row
// ** put custom Rule Action logic here
tbOrderHasShipped.Visible = true;
tbOrderHasNotShipped.Visible = false;
}
private void CreateRowRuleGS_Order_Detail_DataViewCalculated_InvoicedEquals_No()
{
// Description: NotShipped
// **** begin autogenerated code ****
RuleAction[] ruleActions = new RuleAction[0];
// Create RowRule and add to the EpiDataView.
// Dummy Context Object
object contextObject = null;
RowRule rrCreateRowRuleGS_Order_Detail_DataViewCalculated_InvoicedEquals_No = new RowRule("GS_Order_Detail_DataView.Calculated_Invoiced", RuleCondition.Equals, "No", new RowRuleActionDelegate2(this.GS_Order_Detail_DataViewCalculated_InvoicedEqualsNo_CustomRuleAction), contextObject);
((EpiDataView)(this.oTrans.EpiDataViews["GS_Order_Detail_DataView"])).AddRowRule(rrCreateRowRuleGS_Order_Detail_DataViewCalculated_InvoicedEquals_No);
// **** end autogenerated code ****
}
private void GS_Order_Detail_DataViewCalculated_InvoicedEqualsNo_CustomRuleAction(Ice.Lib.ExtendedProps.RowRuleDelegateArgs args)
{
// ** RowRuleDelegateArgs Properties: args.Arg1, args.Arg2, args.Context, args.Row
// ** put custom Rule Action logic here
tbOrderHasShipped.Visible = false;
tbOrderHasNotShipped.Visible = true;
}
private void CallCRMCallAdapterGetNewCRMCallMethod()
{
CRMCallAdapter adapterCRMCall = new CRMCallAdapter(this.oTrans);
adapterCRMCall.BOConnect();
if (adapterCRMCall.GetNewCRMCall("orderhed", tbOrderOrderNum.Text, string.Empty, string.Empty))
{
adapterCRMCall.CRMCallData.CRMCall[0].CallTypeCode = "F6";
adapterCRMCall.CRMCallData.CRMCall[0].CallDesc = "Order Call Note";
adapterCRMCall.CRMCallData.CRMCall[0].CallText = tbOrderNotesNewCall.Text;
adapterCRMCall.Update();
}
}
private void tbOrderNotesNew_Click(object sender, System.EventArgs args)
{
CallCRMCallAdapterGetNewCRMCallMethod();
MessageBox.Show("Order Note Saved");
//GS_Order_Notes.ResetDataView(GS_Order_Notes);
//changeordernumber();
}
}
Is this a Runtime or compiled Assembly dashboard?
It is an Assembly Dashboard
I’m not sure. One thing that is different between your edv and the others (that show columns) is the column names contain table_field. Not sure if it’s related, but its different. Couldnt you just do the subscribe programatically by grabbing the edv that feeds the imported dash?
Programatically - like thru custom code?
I know this is resolved but I am just curious of why are you using an updatable dashboard instead of the wizard to add a custom table.
Because I had to be able to change the data in the table. As far as I know that is the only way you can do that.
or you can use a DynamicQuery in an added EpiUltraGrid then use:
private void YourGridView_AfterCellUpdate(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs args)
{
//cast the new cell value to callcontex variables then to a BPM class to update the target dataBase
}
I see you really need this to be custom but for simpler things you can use the wizard to add crud code for your UD tables and this should work for other BOs.