private void ListofValue_Load(object sender, EventArgs e) { dbConnectionMyob db = new dbConnectionMyob(); //tableName = "select * from Navigation where Name = '" + Navi_Selected + "'"; // dbTable = db.connect(tableName, "Navigation"); // tableName = SQLstr = "select * from X_PROD_QueryIndex where Q_TableName ='" + tableName + "'"; dbTable = db.connect(SQLstr, "QueryIndex"); for (int RecodeCount = 0; RecodeCount < dbTable.Rows.Count; RecodeCount++) { switch (dbTable.Rows[RecodeCount][3].ToString()) { case "Dat": dataGridView1.Rows.Add(dbTable.Rows[RecodeCount][2].ToString(), dbTable.Rows[RecodeCount][3].ToString(), " = "); break; default: dataGridView1.Rows.Add(dbTable.Rows[RecodeCount][2].ToString(), dbTable.Rows[RecodeCount][3].ToString(), "like"); break; } } LoadData(); }
public void GrantAccess(string UID) { db = new dbConnectionMyob(); StrSQL = "Select Sysadmin,ProdCapacitiyPlan,JobCosting,SalesModule from PROD_Staff where ID = '" + UID + "'"; StrSqltable = "PROD_STAFF"; dbDataSet = db.ConnectDataSet(StrSQL, StrSqltable); datatable = dbDataSet.Tables[StrSqltable]; if (datatable.Rows.Count > 0) { int jobcost = 0; int devision = 0; int Sales = 0; // Sys admin..... if (datatable.Rows[0][0].Equals(true)) { jobcost = 1; devision = 1; Sales = 1; } else if (datatable.Rows[0][1].Equals(true)) { devision = 1; } else if (datatable.Rows[0][2].Equals(true)) { jobcost = 1; } else if (datatable.Rows[0][3].Equals(true)) { Sales = 1; } if (jobcost == 0) { tabControl1.TabPages.Remove(Summary); } if (devision == 0) { tabControl1.TabPages.Remove(Operations); } if (Sales == 0) { tabControl1.TabPages.Remove(Setup); } } }
public Login() { InitializeComponent(); db = new dbConnectionMyob(); conn = new SqlConnection(db.DbConecct()); try { conn.Open(); } catch (Exception) { MessageBox.Show("Error with the databse connection"); } }
private void Form1_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'MESDataSet.PROD_JOBCARD' table. You can move, or remove it, as needed. //this.PROD_JOBCARDTableAdapter.FillRouteCard(this.MESDataSet.PROD_JOBCARD); // this.PROD_JobCardViewTableAdapter.FillByLIstofLine(this.MESDataSet.PROD_JobCardView, SalesID, IntArr); StrSQL = @"SELECT ADDRESS1, ADDRESS2, ADDRESS3, ADDRESS4, AddtionalNotes, AssignTo, BINCODE, CUSTORDERNO, CompleteDate, DESCRIPTION, DISPATCH_INFO, Division, Drawing, DueDate, EnableAddNote, EstimatedTime, FinFlientGrey, FinMatBlack, FinNoPaint, FinPaintWeldsOnly, FinPickle, FinPolishWelds, FinSilver, INSTRUCTIONS, InStage, MakeToStock, NAME, Note, OPCode, OpName, OrderDate, OrderQTY, PHONE, PlanProductionDate, PrintBy, ProductionComplete, ProductionQTY, ProductionStartDate, STOCKCODE, SalesEntered, SalesLineRef, ScrapQTY, SoSeqNo, StartDate, Status,Color FROM PROD_JobCardView WHERE (SoSeqNo = " + SalesID + ") " + " AND (SalesLineRef IN ( " + IntArr + "))"; conn = new SqlConnection(global::EXO_MES_Module.Properties.Settings.Default.UpgradeConnectionString); db = new dbConnectionMyob(); conn = new SqlConnection(db.DbConecct()); try { conn.Open(); } catch (Exception) { MessageBox.Show("Error with the databse connection"); } dbDataSet = db.ConnectDataSet(StrSQL, "PROD_JobCardView"); datatable = dbDataSet.Tables[0]; //ReportDataSource reportDataSource = new ReportDataSource(); // Must match the DataSet in the RDLC //reportDataSource.Name = "MESDataSet"; //reportDataSource.Value = datatable; this.reportViewer1.SetDisplayMode(DisplayMode.PrintLayout); var reportDataSource1 = new ReportDataSource("ProdJobCardView", datatable); this.reportViewer1.LocalReport.DataSources.Add(reportDataSource1); this.reportViewer1.LocalReport.ReportEmbeddedResource = "EXO_MES_Module.Report2.rdlc"; this.reportViewer1.LocalReport.Refresh(); this.reportViewer1.RefreshReport(); }
public void DataloadtoList(string StrSql, string Strtable) { db = new dbConnectionMyob(); dbDataSet = db.ConnectDataSet(StrSql, Strtable); datatable2 = dbDataSet.Tables[Strtable]; ListBoxAll.Items.Clear(); listBoxSelected.Items.Clear(); foreach (DataRow row in datatable2.Rows) { if (Convert.ToBoolean(row["Enable"].ToString())) { listBoxSelected.Items.Add(row["OPCode"].ToString()); } else { ListBoxAll.Items.Add(row["OPCode"].ToString()); } } }
/// <summary> /// ..............These functions are used to pass the form objects ........................... /// </summary> /// <returns></returns> // public Company ReturnCurrentForm() { return Subform; } //load Query Window................................................................. /* public query QueryFormload() * { * // New Form Load * query QueryWindow = new query(); * QueryWindow.GetCurrentSubForm(this, "Vendor"); * QueryWindow.Show(); * return QueryWindow; * } */ public void fillter(string StrSQL) { StrSqltable = "PROD_JOBCARD"; db = new dbConnectionMyob(); dbDataSet = db.ConnectDataSet(StrSQL, StrSqltable); datatable = dbDataSet.Tables[StrSqltable]; dataGridView1.DataSource = dbDataSet; dataGridView1.DataMember = StrSqltable; dataGridView1.Refresh(); /* try * { * this.pROD_JOBCARDTableAdapter.FillBy1(datatable); * } * catch (System.Exception ex) * { * System.Windows.Forms.MessageBox.Show(ex.Message); * }*/ this.FormatDashbord(); }
public void DataloadtoDrawingList(string StrSql, string Strtable) { db = new dbConnectionMyob(); dbDataSet = db.ConnectDataSet(StrSql, Strtable); datatable2 = dbDataSet.Tables[Strtable]; }
public ExoJobOrder(int SEQNO) { InitializeComponent(); TxtOrderId.Text = SEQNO.ToString(); Save_Chanages = false; // soSeqNoToolStripTextBox.Text = SEQNO.ToString(); this.Text = "Production Order " + TxtOrderId.Text; conn = new SqlConnection(global::EXO_MES_Module.Properties.Settings.Default.UpgradeConnectionString); db = new dbConnectionMyob(); conn = new SqlConnection(db.DbConecct()); try { conn.Open(); } catch (Exception) { MessageBox.Show("Error with the databse connection"); } // Load Sales order lines MainLIstViewDataload(); // FillControlers(0, false); OperationLoad(); try { this.pROD_JOBCARDTableAdapter.Summary(this.mESDataSet.PROD_JOBCARD, new System.Nullable <int>(((int)(System.Convert.ChangeType(TxtOrderId.Text, typeof(int)))))); } catch (System.Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } if (pROD_ROUTEDataGridView.RowCount > 0) { tabControl1.SelectedIndex = 0; InsertData.Enabled = true; Save.Enabled = true; GridView.Enabled = false; DeleteRecord.Enabled = true; NewIndex.Enabled = false; Refresh1.Enabled = true; } if (checkBox1.CheckState == CheckState.Checked) { richTextBox2.Visible = true; } else { richTextBox2.Visible = false; } }
private void EnableMenu() { db = new dbConnectionMyob(); StrSQL = "Select SalesModule,Sysadmin,DashbordStatus,DashbordInstage,DashbordEstimatedETA,DashbordProdStart,DashboardProdEnd, Jobcostsales,Jobcostcost, JobCostGP from PROD_Staff where ID = '" + this.Text + "'"; StrSqltable = "PROD_STAFF"; dbDataSet = db.ConnectDataSet(StrSQL, StrSqltable); datatable = dbDataSet.Tables[StrSqltable]; if (datatable.Rows.Count > 0) { if (datatable.Rows[0][0].Equals(true)) { salesOrdersToolStripMenuItem.Enabled = true; } else { salesOrdersToolStripMenuItem.Enabled = false; } if (datatable.Rows[0][1].Equals(true)) { administrationToolStripMenuItem1.Enabled = true; } else { administrationToolStripMenuItem1.Enabled = false; } if (!datatable.Rows[0][2].Equals(true)) { dataGridView1.Columns[3].Visible = false; } if (!datatable.Rows[0][3].Equals(true)) { dataGridView1.Columns[4].Visible = false; } if (!datatable.Rows[0][4].Equals(true)) { dataGridView1.Columns[7].Visible = false; } if (!datatable.Rows[0][5].Equals(true)) { dataGridView1.Columns[9].Visible = false; } if (!datatable.Rows[0][6].Equals(true)) { dataGridView1.Columns[10].Visible = false; } if (!datatable.Rows[0][7].Equals(true)) { dataGridView1.Columns[11].Visible = false; } if (!datatable.Rows[0][8].Equals(true)) { dataGridView1.Columns[12].Visible = false; } if (!datatable.Rows[0][9].Equals(true)) { dataGridView1.Columns[13].Visible = false; } } }