예제 #1
0
        private void MainLIstViewDataload()
        {
            StrSqltable = "PROD_SALESHEADER";
            StrSQL      = "SELECT [Sales Order],[Invoice Account] ,[Customer Name] ,[Order Date] ,[Due Date] ,[Customer Ref] ,[Status]"
                          + "FROM [PROD_SALESHEADER]"
                          + " Where[PROD_SALESHEADER].[StatusID] < 2 order by [Sales Order] desc";


            dbDataSet = db.ConnectDataSet(StrSQL, StrSqltable);
            datatable = dbDataSet.Tables[StrSqltable];
            SubFormGrid.DataSource = dbDataSet;
            SubFormGrid.DataMember = StrSqltable;
            SubFormGrid.Refresh();
            SubFormGrid.SelectedRows.Equals(0);

            InsertData.Enabled   = false;
            Save.Enabled         = false;
            SaveAll.Enabled      = false;
            DeleteRecord.Enabled = false;
            NewIndex.Enabled     = true;
            Refresh1.Enabled     = false;


            if (datatable.Rows.Count > 0)
            {
                currRecord = 0;
                //ValidateTextboxes();
            }
            else
            {
                SaleID.Text = "";
            }
        }
예제 #2
0
        private void ButtLogin_Click(object sender, EventArgs e)
        {
            if (textPass.Text == "" || TxtUserID.Text == "")
            {
                MessageBox.Show("Empty Login Name or Password ");
            }
            else
            {
                StrSQL      = "Select ID from PROD_Staff where ENABLE =1 and password = '******' and UserId = '" + TxtUserID.Text + "'";
                StrSqltable = "PROD_STAFF";
                dbDataSet   = db.ConnectDataSet(StrSQL, StrSqltable);
                datatable   = dbDataSet.Tables[StrSqltable];

                if (datatable.Rows.Count > 0)
                {
                    MainForm M1 = new MainForm(datatable.Rows[0][0].ToString());
                    this.Hide();
                    M1.Show();
                }
                else

                {
                    MessageBox.Show("Invalid Login Name or Password ");
                }
            }



            // this.Close();
        }
예제 #3
0
        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);
                }
            }
        }
예제 #4
0
        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();
        }
예제 #5
0
        private void MainLIstViewDataload()
        {
            StrSqltable = "SALESORD_LINES";
            StrSQL      = "SELECT [SOLINEID],[STOCKCODE],[DESCRIPTION] "
                          + ",[ORD_QUANT],[INV_QUANT],[UNITPRICE] ,[LOCATION]"
                          + " FROM [SALESORD_LINES] where X_PRODUCTIONREQUIRED ='Y' and HDR_SEQNO =" + TxtOrderId.Text;


            try
            {
                this.pROD_SALESHEADERTableAdapter.Fill(this.mESDataSet.PROD_SALESHEADER, ((int)(System.Convert.ChangeType(TxtOrderId.Text, typeof(int)))));
            }
            catch (System.Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }



            dbDataSet = db.ConnectDataSet(StrSQL, StrSqltable);
            datatable = dbDataSet.Tables[StrSqltable];
            SubFormGrid.DataSource = dbDataSet;
            SubFormGrid.DataMember = StrSqltable;
            SubFormGrid.Refresh();
            SubFormGrid.SelectedRows.Equals(0);

            InsertData.Enabled = false;
            Save.Enabled       = true;
            splitContainer1.SplitterDistance = 25;

            DeleteRecord.Enabled = false;
            NewIndex.Enabled     = false;
            Refresh1.Enabled     = false;



            if (datatable.Rows.Count > 0)
            {
                currRecord = 0;
            }
        }
예제 #6
0
        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());
                }
            }
        }
예제 #7
0
        /// <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();
        }
예제 #8
0
 public void DataloadtoDrawingList(string StrSql, string Strtable)
 {
     db         = new dbConnectionMyob();
     dbDataSet  = db.ConnectDataSet(StrSql, Strtable);
     datatable2 = dbDataSet.Tables[Strtable];
 }
예제 #9
0
        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;
                }
            }
        }