Beispiel #1
0
        protected override void InitForm()
        {
            formCode = "SFMobileInfo";
            base.InitForm();
            this.Text = Pub.GetResText(formCode, "mnu" + formCode, "", new string[] { "Main" });
            TMobileInfo info = new TMobileInfo("");

            IP              = info.IP;
            Port            = info.Port;
            KeyID           = info.KeyID;
            MercID          = info.MercID;
            TrmNo           = info.TrmNo;
            PWD             = info.PWD;
            Rate11          = info.Rate11;
            Rate12          = info.Rate12;
            Rate21          = info.Rate21;
            Rate22          = info.Rate22;
            MobTyp          = info.MobTyp;
            XJLName         = info.XJLName;
            XJLPWD          = info.XJLPWD;
            rbType1.Checked = MobTyp == 0;
            txtIP.Text      = IP;
            txtPort.Text    = Port.ToString();
            txtMercID.Text  = MercID;
            txtTrmNo.Text   = TrmNo;
            txtPWD.Text     = PWD;
            rbType2.Checked = !rbType1.Checked;
            txtXJLName.Text = XJLName;
            txtXJLPWD.Text  = XJLPWD;
            cbbRate1.Items.Clear();
            cbbRate2.Items.Clear();
            for (int i = 0; i < 3; i++)
            {
                string s = Pub.GetResText(formCode, "Rate" + i.ToString(), "");
                cbbRate1.Items.Add(s);
                cbbRate2.Items.Add(s);
            }
            cbbRate1.SelectedIndex = Rate11;
            txtRate1.Text          = Rate12.ToString();
            cbbRate2.SelectedIndex = Rate21;
            txtRate2.Text          = Rate22.ToString();
            if (info.WeiXin.Length > 0)
            {
                picWX.BackgroundImage = Image.FromStream(info.WeiXin);
            }
            if (info.AliPay.Length > 0)
            {
                picAli.BackgroundImage = Image.FromStream(info.AliPay);
            }
            SetTextboxNumber(txtPort);
            SetTextboxNumber(txtRate1);
            SetTextboxNumber(txtRate2);
        }
Beispiel #2
0
 private void timer_Tick(object sender, EventArgs e)
 {
     this.lblTime.Text = DateTime.Now.ToString(LocalFormat);
     if (SystemInfo.IgnoreMobile)
     {
         return;
     }
     try
     {
         string CardID = "";
         if (!DeviceObject.objCard.MobileCheck(ref CardID))
         {
             MobileStatusText = string.Format(Pub.GetResText(formCode, "MobileCancelOrd", ""), CardID);
             if (MobileStatusTextOld != MobileStatusText)
             {
                 SetMDICaption();
                 MobileStatusTextOld = MobileStatusText;
             }
             TMobileInfo MobileInfo;
             MobileInfo = new TMobileInfo("");
             DeviceObject.objCard.MobileInit(MobileInfo.MobTyp, MobileInfo.MercID, MobileInfo.TrmNo, MobileInfo.PWD,
                                             MobileInfo.XJLName, MobileInfo.XJLPWD);
             string ErrMsg = "";
             if (DeviceObject.objCard.MobileCancel(ref ErrMsg))
             {
                 db.MobileCancelOrdSave(CardID, ErrMsg);
             }
         }
         else
         {
             MobileStatusText = "";
             if (MobileStatusTextOld != MobileStatusText)
             {
                 SetMDICaption();
                 MobileStatusTextOld = MobileStatusText;
             }
         }
     }
     catch
     {
     }
 }
Beispiel #3
0
        protected override void InitForm()
        {
            formCode = "SFDeposit";
            base.InitForm();
            this.Text       = Pub.GetResText(formCode, "mnu" + formCode, "", new string[] { "Main" });
            txtMoney.Enter += TextBoxCurrency_Enter;
            txtMoney.Leave += TextBoxCurrency_Leave;
            double d = SystemInfo.DefDepositMoney;

            txtMoney.Text     = d.ToString(SystemInfo.CurrencySymbol + "0.00");
            ExistsDepositType = SystemInfo.HasMoreDepositType;
            if (ExistsDepositType)
            {
                cbbType.Items.Clear();
                DataTableReader dr = null;
                try
                {
                    if (!db.IsOpen)
                    {
                        db.Open(SystemInfo.ConnStr);
                    }
                    dr = db.GetDataReader(Pub.GetSQL(DBCode.DB_004013, new string[] { "102" }));
                    dr.Read();
                    cbbType.Items.Add(new TCommonType(dr["SFTypeSysID"].ToString(), dr["SFTypeID"].ToString(),
                                                      dr["SFTypeName"].ToString(), true));
                    dr.Close();
                    dr = db.GetDataReader(Pub.GetSQL(DBCode.DB_004013, new string[] { "0" }));
                    while (dr.Read())
                    {
                        cbbType.Items.Add(new TCommonType(dr["GUID"].ToString(), dr["DepositTypeID"].ToString(),
                                                          dr["DepositTypeName"].ToString(), true));
                    }
                }
                catch (Exception E)
                {
                    Pub.ShowErrorMsg(E);
                }
                finally
                {
                    if (dr != null)
                    {
                        dr.Close();
                    }
                    dr = null;
                }
                if (cbbType.Items.Count > 0)
                {
                    cbbType.SelectedIndex = 0;
                }
                if (cbbType.Items.Count == 1)
                {
                    ExistsDepositType = false;
                }
            }
            txtMoney.Focus();
            toolTip.SetToolTip(picDisc, Pub.GetResText(formCode, "DiscHint", ""));
            cbbType.Enabled        = ExistsDepositType;
            cbbType.Visible        = cbbType.Enabled;
            label7.Visible         = cbbType.Enabled;
            OkContinue             = SystemInfo.ini.ReadIni("Public", "CardOk", true);
            lblShowMoney.Font      = new Font(Font.Name, 35, FontStyle.Bold);
            lblShowMoney.ForeColor = Color.Red;
            chkPrint.Checked       = SystemInfo.ini.ReadIni("Public", "CheckPrint", false);
            AllowPayCode           = SystemInfo.ini.ReadIni("Public", "AllowPayCode", false);
            AllowPayUSB            = SystemInfo.ini.ReadIni("Public", "AllowPayUSB", false);
            if (AllowPayCode)
            {
                chkPayCode.Checked = SystemInfo.ini.ReadIni("Public", "PayCode", false);
            }
            if (AllowPayUSB)
            {
                chkPayCodeUSB.Checked = SystemInfo.ini.ReadIni("Public", "PayCodeUSB", false);
            }
            MobileInfo = new TMobileInfo("");
            DeviceObject.objCard.MobileInit(MobileInfo.MobTyp, MobileInfo.MercID, MobileInfo.TrmNo, MobileInfo.PWD, MobileInfo.XJLName, MobileInfo.XJLPWD);
            Pub.InitCommList(cbbCommPort);
            cbbCommPort.Text = SystemInfo.ini.ReadIni("Public", "PayComm", "");
            if (cbbCommPort.SelectedIndex == -1)
            {
                cbbCommPort.SelectedIndex = 0;
            }
            DeviceObject.objCard.MobilePayCodeInit();
        }
        protected override void InitForm()
        {
            formCode = "SFMobileCheck";
            retGrid.Columns.Clear();
            AddColumn(retGrid, 0, "RecordNo", false, true, 1, 60);
            AddColumn(retGrid, 0, "OrderNo", false, true, 1, 200);
            AddColumn(retGrid, 0, "OrderTime", false, true, 1, 130);
            AddColumn(retGrid, 0, "PayTime", false, true, 1, 130);
            AddColumn(retGrid, 1, "IsWX", false, true, 1, 70);
            AddColumn(retGrid, 0, "Amount", false, true, 1, 70);
            AddColumn(retGrid, 0, "OrderRemark", false, true, 1, 270);
            base.InitForm();
            for (int i = 0; i < retGrid.ColumnCount; i++)
            {
                retGrid.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
            }
            this.Text             = Pub.GetResText(formCode, "mnu" + formCode, "", new string[] { "Main" });
            dtpStart.Value        = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1, 0, 0, 0);
            dtpEnd.Value          = DateTime.Now.Date.AddHours(23).AddMinutes(59).AddSeconds(59);
            dtpStart.CustomFormat = SystemInfo.DateTimeFormat;
            dtpEnd.CustomFormat   = SystemInfo.DateTimeFormat;
            UserList.Clear();
            List <string> SysID = new List <string>();
            TMobileInfo   info  = new TMobileInfo("");

            UserList.Add(info);
            DataTableReader dr  = null;
            string          s01 = "";
            string          s02 = "";
            string          s11 = "";
            string          s12 = "";

            try
            {
                dr = db.GetDataReader(Pub.GetSQL(DBCode.DB_004004, new string[] { "0" }));
                while (dr.Read())
                {
                    SysID.Add(dr["MacSysID"].ToString());
                }
                for (int i = 0; i < SysID.Count; i++)
                {
                    dr.Close();
                    dr = db.GetDataReader(Pub.GetSQL(DBCode.DB_004004, new string[] { "7", SysID[i] }));
                    if (dr.Read())
                    {
                        s01 = dr["MobileInfo"].ToString();
                        if (s01 == "")
                        {
                            continue;
                        }
                        info = new TMobileInfo(s01);
                        if (UserList.Count > 0)
                        {
                            s01 = UserList[UserList.Count - 1].KeyID + UserList[UserList.Count - 1].MercID + UserList[UserList.Count - 1].TrmNo +
                                  UserList[UserList.Count - 1].PWD;
                            s02 = info.KeyID + info.MercID + info.TrmNo + info.PWD;
                            s11 = UserList[UserList.Count - 1].XJLName + UserList[UserList.Count - 1].XJLPWD;
                            s12 = info.XJLName + info.XJLPWD;
                            if (UserList[UserList.Count - 1].MobTyp != info.MobTyp)
                            {
                                UserList.Add(info);
                            }
                            else if (UserList[UserList.Count - 1].MobTyp == 0 && s01 != s02)
                            {
                                UserList.Add(info);
                            }
                            else if (UserList[UserList.Count - 1].MobTyp == 1 && s11 != s12)
                            {
                                UserList.Add(info);
                            }
                        }
                    }
                }
            }
            catch (Exception E)
            {
                Pub.ShowErrorMsg(E);
            }
            finally
            {
                if (dr != null)
                {
                    dr.Close();
                }
                dr = null;
            }
            clbUserInfo.Items.Clear();
            for (int i = 0; i < UserList.Count; i++)
            {
                info = UserList[i];
                if (info.MobTyp == 0)
                {
                    s01 = info.MercID + "[" + info.TrmNo + "]";
                }
                else
                {
                    s01 = info.XJLName + "[" + info.XJLPWD + "]";
                }
                clbUserInfo.Items.Add(s01);
                clbUserInfo.SetItemChecked(clbUserInfo.Items.Count - 1, true);
            }
        }
Beispiel #5
0
        protected override void InitForm()
        {
            formCode = "SFDepositRef";
            base.InitForm();
            this.Toolbar.Visible   = false;
            this.Statusbar.Visible = false;
            Font fnt = new Font(this.Font.FontFamily, 20);

            txtMoney.Enter  += TextBoxCurrency_Enter;
            txtMoney.Leave  += TextBoxCurrency_Leave;
            txtMoney1.Enter += TextBoxCurrency_Enter;
            txtMoney1.Leave += TextBoxCurrency_Leave;
            double d = SystemInfo.DefDepositMoney;

            txtMoney.Text  = d.ToString(SystemInfo.CurrencySymbol + "0.00");
            d              = 0;
            txtMoney1.Text = d.ToString(SystemInfo.CurrencySymbol + "0.00");
            ResetForm(0);
            ResetForm(1);
            ExistsDepositType = SystemInfo.HasMoreDepositType;
            if (ExistsDepositType)
            {
                cbbType.Items.Clear();
                DataTableReader dr = null;
                try
                {
                    if (!db.IsOpen)
                    {
                        db.Open(SystemInfo.ConnStr);
                    }
                    dr = db.GetDataReader(Pub.GetSQL(DBCode.DB_004013, new string[] { "102" }));
                    dr.Read();
                    cbbType.Items.Add(new TCommonType(dr["SFTypeSysID"].ToString(), dr["SFTypeID"].ToString(),
                                                      dr["SFTypeName"].ToString(), true));
                    dr.Close();
                    dr = db.GetDataReader(Pub.GetSQL(DBCode.DB_004013, new string[] { "0" }));
                    while (dr.Read())
                    {
                        cbbType.Items.Add(new TCommonType(dr["GUID"].ToString(), dr["DepositTypeID"].ToString(),
                                                          dr["DepositTypeName"].ToString(), true));
                    }
                }
                catch (Exception E)
                {
                    Pub.ShowErrorMsg(E);
                }
                finally
                {
                    if (dr != null)
                    {
                        dr.Close();
                    }
                    dr = null;
                }
                if (cbbType.Items.Count > 0)
                {
                    cbbType.SelectedIndex = 0;
                }
                if (cbbType.Items.Count == 1)
                {
                    ExistsDepositType = false;
                }
            }
            cbbType.Enabled          = ExistsDepositType;
            cbbType.Visible          = cbbType.Enabled;
            label10.Visible          = cbbType.Enabled;
            txtUpDepositType.Enabled = ExistsDepositType;
            txtUpDepositType.Visible = txtUpDepositType.Enabled;
            lblUpDepositType.Visible = txtUpDepositType.Enabled;
            txtMoney.Focus();
            toolTip.SetToolTip(picDisc, Pub.GetResText(formCode, "DiscHint", ""));
            OkContinue        = SystemInfo.ini.ReadIni("Public", "CardOk", true);
            chkPrint.Checked  = SystemInfo.ini.ReadIni("Public", "CheckPrint", false);
            checkBox1.Checked = SystemInfo.ini.ReadIni("Public", "CheckPrint1", false);
            MobileInfo        = new TMobileInfo("");
            DeviceObject.objCard.MobileInit(MobileInfo.MobTyp, MobileInfo.MercID, MobileInfo.TrmNo, MobileInfo.PWD, MobileInfo.XJLName, MobileInfo.XJLPWD);
        }