private void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                ProductionPlanUI x = new ProductionPlanUI();

                string xp = (Convert.ToInt32(productiondate.Substring(0, 4)) + 1).ToString() + (Convert.ToInt32(productiondate.Substring(4, 2)) + 1).ToString() + (Convert.ToInt32(productiondate.Substring(6, 2)) + 1).ToString();

                if (txtPwd.Text == xp)
                {
                    SQL       sq       = new SQL();
                    DataTable dtDelete = new DataTable();
                    dtDelete =
                        sq.get_rs("delete from t_pcpln where productiondate ='" + productiondate + "' and category = '" +
                                  prodGroup.Substring(3, 10) + "' and shifttype = '" + shiftType + "'");
                    MessageBox.Show("Delete successfull");
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Invalid Password!!");
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
        }
Beispiel #2
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            ProductionPlanUI mainForm = new ProductionPlanUI();

            AccpacCOMAPI.AccpacSession session = new AccpacCOMAPI.AccpacSession();
            // this.Cursor = Cursors.WaitCursor;
            session.Init("", "IC60A", "IC2000", "60A");
            try
            {
                session.Open(txtUserId.Text, txtPassword.Text, "TCPDAT", dateTimePicker1.Value, 0, "");

                AccpacCOMAPI.AccpacDBLink mDBLinkCmpRW = session.OpenDBLink(AccpacCOMAPI.tagDBLinkTypeEnum.DBLINK_COMPANY, AccpacCOMAPI.tagDBLinkFlagsEnum.DBLINK_FLG_READWRITE);
                AccpacCOMAPI.AccpacDBLink mDBLinkSysRW = session.OpenDBLink(AccpacCOMAPI.tagDBLinkTypeEnum.DBLINK_SYSTEM, AccpacCOMAPI.tagDBLinkFlagsEnum.DBLINK_FLG_READWRITE);
                mainForm.session      = session;
                mainForm.mDBLinkCmpRW = mDBLinkCmpRW;
                mainForm.mDBLinkSysRW = mDBLinkSysRW;

                this.Hide();
                mainForm.Show();
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message);
            }
        }