Esempio n. 1
0
        private void frmMember_Load(object sender, EventArgs e)
        {
            bool    result   = false;
            frmLoad loadForm = new frmLoad("Checking Connection.", "Loading Screen");

            loadForm.BackgroundWorker.DoWork += (sender1, e1) =>
            {
                result = mySQLFunc.check_connection_main();
            };
            loadForm.ShowDialog();
            if (!result)
            {
                fncFilter.alert("Member feature is Offline.");
                Close();
                return;
            }
            ClearControlsData();
            if (member.getSyncId() != 0)
            {
                this.txtCardID.Text     = this.member.getcardid();
                this.lblName.Text       = this.member.getfullname() + "\n" + this.member.getmobile() + "\n" + this.member.getbirhtdate();
                this.lblMemberType.Text = this.member.get_memberrate_name();
                this.lblPoints.Text     = this.member.getPreviousPoints().ToString("N2");
            }
            else
            {
                btnRemove.Visible = false;
            }

            fncFullScreen fncfullscreen = new fncFullScreen(this);

            fncfullscreen.ResizeFormsControls();

            tempMember = member;
        }
Esempio n. 2
0
        private void addcustomer()
        {
            if (dgvCustomer.SelectedRows.Count <= 0)
            {
                return;
            }
            long SyncId = Convert.ToInt32(dgvCustomer.SelectedRows[0].Cells["colWid"].Value);

            frmLoad loadForm = new frmLoad("Loading Customer Data", "Loading Screen");

            loadForm.BackgroundWorker.DoWork += (sender, e1) =>
            {
                this.customer = new cls_customer(SyncId);
            };
            loadForm.ShowDialog();
            this.Close();
        }
Esempio n. 3
0
 private void frmChange_c_Shown(object sender, EventArgs e)
 {
     if (Visible && flag)
     {
         flag = false;
         int  temp  = 0;
         bool retry = false;
         do
         {
             retry = false;
             frmLoad loadForm = new frmLoad("Saving Transaction", "Loading Screen");
             loadForm.BackgroundWorker.DoWork += (sender1, e1) =>
             {
                 temp = POSMain.save_transaction_thread(tran);
             };
             loadForm.ShowDialog();
             if (temp == 0)
             {
                 LogsHelper.Print("Tender success");
             }
             else if (temp == 1)
             {
                 fncFilter.alert("Member transaction was unable to complete due to connection problems. F8 - Payment to try again.");
                 LogsHelper.Print("Tender failed: Member Feature Offline");
                 isTransactionDone = false;
             }
             else if (temp == -1)
             {
                 LogsHelper.Print("Tender failed: General Saving failure");
                 if (DialogHelper.ShowDialog("An error occured in saving transaction. Would you like to retry?", MessageBoxButtons.YesNo) == DialogResult.Yes)
                 {
                     retry = true;
                     LogsHelper.Print("Tender failure popup: Retry");
                 }
                 else
                 {
                     LogsHelper.Print("Tender failure popup: Ignore");
                     fncHardware.print_receipt(tran, false, false);
                 }
             }
         }while (retry);
     }
 }
Esempio n. 4
0
        private bool search_member()
        {
            this.txtCardID.Focus();
            this.txtCardID.SelectAll();

            string str = txtCardID.Text.Replace(";", "").Replace("?", "");

            if (str.Length <= 0)
            {
                fncFilter.alert(cls_globalvariables.warning_member_notregistered);
                ClearControlsData();
                return(false);
            }

            cls_member member_temp = new cls_member();
            frmLoad    loadForm    = new frmLoad("Searching for Member", "Loading Screen");

            loadForm.BackgroundWorker.DoWork += (sender1, e1) =>
            {
                member_temp.setcls_member_by_cardid(str);
            };
            loadForm.ShowDialog();

            if (member_temp.getSyncId() == 0)
            {
                fncFilter.alert(cls_globalvariables.warning_member_notregistered);
                ClearControlsData();
                return(false);
            }

            this.lblName.Text       = member_temp.getfullname() + "\n" + member_temp.getmobile() + "\n" + member_temp.getbirhtdate();
            this.lblPoints.Text     = member_temp.getPreviousPoints().ToString("N2");
            this.lblMemberType.Text = member_temp.get_memberrate_name();
            this.member             = member_temp;
            return(true);
        }