示例#1
0
        //===================================BUTTON oke===================================
        private void b_ok_Click(object sender, EventArgs e)
        {
            Boolean api_response;
            CRUD    sql = new CRUD();

            try
            {
                if (cek_closing_shift == "0")
                {
                    MessageBox.Show("Please Closing Shift First Before Closing Store");
                }
                else
                {
                    clearUploadSyncHist();

                    if (cash_label <= 0)
                    {
                        update_close();

                        String cmd_deleteTmp = "DELETE FROM [tmp].[" + store_code + "]";
                        sql.ExecuteNonQuery(cmd_deleteTmp);

                        //===========API CLOSING STORE============
                        API_Closing_Store closing_Store = new API_Closing_Store();
                        closing_Store.get_code(id_cStrore2);
                        api_response = closing_Store.Post_Closing_Store().Result;

                        if (api_response)
                        {
                            //========for logout========
                            UC_Closing_Store.Instance.reset();
                            f1.Hide();
                            this.Hide();
                            Form_Login login = new Form_Login();
                            login.ShowDialog();
                            f1.Close();
                            this.Close();
                        }
                        else
                        {
                            String cmd_update = "UPDATE closing_store SET STATUS_CLOSE='0' WHERE ID_C_STORE='" + id_cStrore2 + "'";
                            CRUD   update     = new CRUD();
                            update.ExecuteNonQuery(cmd_update);

                            MessageBox.Show("Make Sure You are Connected To Internet");
                        }
                    }
                    else
                    {
                        MessageBox.Show("Tidak bisa closing store karena ada perbedaaan antara jumlah fisik dengan sistem");
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        //==================BUTTON OK=====================================
        private void b_ok_Click(object sender, EventArgs e)
        {
            Boolean api_response;

            try
            {
                if (cash_label <= 0)
                {
                    //==========API CLOSING SHIFT=============
                    update();
                    API_Closing_shift close = new API_Closing_shift();
                    close.get_code(id_shift2);
                    api_response = close.Post_Closing_Shift().Result;

                    if (api_response)
                    {
                        UC_Closing_Shift.Instance.reset();
                        //DELETE TRANSAKSI YG DI HOLD DENGAN ID CLOSING SHIFT
                        Del_Trans_Hold DEL = new Del_Trans_Hold();
                        DEL.get_data(id_shift2);
                        DEL.del_trans();
                        DEL.update_runningNumber();
                        //DEL.update_table();
                        //========for logout========
                        f1.Hide();
                        this.Hide();
                        Form_Login login = new Form_Login();
                        login.ShowDialog();
                        f1.Close();
                        this.Close();
                    }
                    else
                    {
                        String cmd_update = "UPDATE closing_shift SET STATUS_CLOSE='0' WHERE ID_SHIFT='" + id_shift2 + "'";
                        CRUD   update     = new CRUD();
                        update.ExecuteNonQuery(cmd_update);

                        MessageBox.Show("Make Sure You are Connected To Internet");
                    }
                }
                else
                {
                    MessageBox.Show("Tidak bisa closing shift karena ada perbedaaan antara jumlah fisik dengan sistem");
                }
            }
            catch (Exception EX)
            {
                MessageBox.Show(EX.ToString());
            }
        }
示例#3
0
        private void b_logout_Click(object sender, EventArgs e)
        {
            f1.Hide();
            this.Hide();

            //f1.Hide();
            //f1.Hide();
            Form_Login login = new Form_Login();

            login.ShowDialog();

            f1.Close();
            this.Close();
            //this.Hide();
            //Form_Login login = new Form_Login();
            //Form1 f1 = new Form1();

            //login.ShowDialog();
            //this.Close();
            //f1.Close();

            //Application.Exit();
        }