/// <summary>
        /// Process for check user login & update flag in table true9_bpt_reserve_id
        /// </summary>
        private void NewDiscount()
        {
            //ConnectionTemp = new OracleConnection();
            //string connString = "Data Source=(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 172.19.193.20)(PORT = 1560))" +
            //       "(CONNECT_DATA = (SID = TEST03)));User Id= TRUREF71; Password= TRUREF71;";

            //ConnectionTemp.ConnectionString = connString;

            try
            {
                //ConnectionTemp.Open();

                ConnectionTemp = ConnectionProd;

                bool hasUserInProcess = reserv.checkStatus(ConnectionTemp, "Disc", user, urNo);

                if (hasUserInProcess == false)
                {
                    int dcID = reserv.reserveID(ConnectionTemp, ConnectionProd, "Disc", user, urNo);
                    ExecuteNewDC(dcID);
                }
            }
            catch (Exception ex)
            {
                Cursor.Current = Cursors.Default;
                MessageBox.Show("Failed..." + "\r\n" + ex.Message);

                this.Close();
                home.Show();
            }
        }
예제 #2
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;

            ConnectionTemp = new OracleConnection();
            string connString = "Data Source=(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 172.19.193.20)(PORT = 1560))" +
                                "(CONNECT_DATA = (SID = TEST03)));User Id= TRUREF71; Password= TRUREF71;";

            ConnectionTemp.ConnectionString = connString;

            //ConnectionTemp = ConnectionProd;

            string inactiveCode = CheckVasCode();

            try
            {
                ConnectionTemp.Open();

                bool hasUserInProcess = reserv.checkStatus(ConnectionTemp, "VAS", user, urNo);

                if (hasUserInProcess == false)
                {
                    if (inactiveCode != "")
                    {
                        DialogResult result = MessageBox.Show("VasCode is inactive in table VAS_PRODUCT, Please review and confirm about these code."
                                                              + "\r\n" + "Detail : " + inactiveCode, "Invalid Code", MessageBoxButtons.OK);
                    }
                    else
                    {
                        int vasID = reserv.reserveID(ConnectionTemp, ConnectionProd, "VAS", user, urNo);

                        Execute(vasID);

                        if (log != "")
                        {
                            string strFilePath = outputPath + "\\log_" + urNo + ".txt";

                            using (StreamWriter writer = new StreamWriter(strFilePath, true))
                            {
                                writer.Write(log);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Cursor.Current = Cursors.Default;
                MessageBox.Show("Failed..." + "\r\n" + ex.Message);

                Application.Exit();
            }

            Cursor.Current = Cursors.Default;
        }