Пример #1
0
 public Login()
 {
     InitializeComponent();
     db   = new dbConnectionMyob();
     conn = new SqlConnection(db.DbConecct());
     try
     {
         conn.Open();
     }
     catch (Exception)
     {
         MessageBox.Show("Error with the databse connection");
     }
 }
Пример #2
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();
        }
Пример #3
0
        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;
            }
        }