// Token: 0x06000438 RID: 1080 RVA: 0x0003F4A8 File Offset: 0x0003D6A8
        private void queryBtn_Click(object sender, EventArgs e)
        {
            DbUtil dbUtil = new DbUtil();
            string text   = "";

            if (this.identityCardNumTB.Text.Trim() != "")
            {
                dbUtil.AddParameter("identityId", this.identityCardNumTB.Text.Trim());
                text += "identityId=@identityId";
            }
            if (this.nameTB.Text.Trim() != "")
            {
                dbUtil.AddParameter("username", this.nameTB.Text.Trim());
                text = text + ((text == "") ? "" : " AND ") + "username=@username";
            }
            if (this.phoneNumTB.Text.Trim() != "")
            {
                dbUtil.AddParameter("phoneNum", this.phoneNumTB.Text.Trim());
                text = text + ((text == "") ? "" : " AND ") + "phoneNum=@phoneNum";
            }
            if (text == "")
            {
                WMMessageBox.Show(this, "请至少输入一个查询条件!");
                return;
            }
            text += " AND isActive<>@isActive";
            dbUtil.AddParameter("isActive", "2");
            this.dt = dbUtil.ExecuteQuery("SELECT * FROM usersTable WHERE " + text);
            if (this.dt == null || this.dt.Rows == null || this.dt.Rows.Count == 0)
            {
                WMMessageBox.Show(this, "没有查询到相关用户!");
                return;
            }
            this.loadData();
        }
Beispiel #2
0
        // Token: 0x0600042E RID: 1070 RVA: 0x0003DDE0 File Offset: 0x0003BFE0
        private void doAction()
        {
            string text  = this.nameTB.Text;
            string value = this.identityCardNumTB.Text.Trim();
            string text2 = this.phoneNumTB.Text;
            string text3 = this.addressTB.Text;
            string text4 = string.Concat(this.getSelectUserTypeId());

            if (text4 == "0")
            {
                return;
            }
            string   value2 = string.Concat(this.getSelectPriceConsistId());
            DateTime now    = DateTime.Now;
            long     num    = (long)(now - WMConstant.DT1970).TotalSeconds;

            this.db.AddParameter("userId", this.userIdTB.Text.Trim());
            this.db.AddParameter("username", text);
            this.db.AddParameter("phoneNum", text2);
            this.db.AddParameter("identityId", value);
            this.db.AddParameter("address", text3);
            this.db.AddParameter("operator", MainForm.getStaffId());
            this.db.AddParameter("userArea", this.userAreaNumTB.Text.Trim());
            this.db.AddParameter("userPersons", this.usrePersonsTB.Text.Trim());
            this.db.AddParameter("userTypeId", text4);
            this.db.AddParameter("createTime", string.Concat(num));
            this.db.AddParameter("userPriceConsistId", value2);
            this.db.AddParameter("permanentUserId", this.permanentUserIdTB.Text);
            this.db.ExecuteNonQuery("UPDATE usersTable SET username=@username, phoneNum=@phoneNum, identityId=@identityId, address=@address, userArea=@userArea, userPersons=@userPersons, userTypeId=@userTypeId, userPriceConsistId=@userPriceConsistId, createTime=@createTime, operator=@operator WHERE permanentUserId=@permanentUserId");
            this.initDGV("userId", this.userIdTB.Text.Trim());
            WMMessageBox.Show(this, "修改成功");
            this.enterBtn.Enabled    = false;
            this.orginalUserIdentity = "";
        }
Beispiel #3
0
 // Token: 0x0600041D RID: 1053 RVA: 0x0003C4B4 File Offset: 0x0003A6B4
 private void enterBtn_Click(object sender, EventArgs e)
 {
     this.enterBtn.Enabled = false;
     if (this.cce == null)
     {
         WMMessageBox.Show(this, "请先读取用户卡!");
         return;
     }
     if (this.parentForm != null)
     {
         ConsumeCardEntity consumeCardEntity = this.parseCard(false);
         if (consumeCardEntity != null)
         {
             if (this.cce.UserId != consumeCardEntity.UserId)
             {
                 WMMessageBox.Show(this, "与读取的卡片内容不符,请检查是否更换了卡片!");
                 return;
             }
             consumeCardEntity.DeviceHead.ChangeMeterFlag = 1U;
             consumeCardEntity.DeviceHead.DeviceIdFlag    = 1U;
             consumeCardEntity.DeviceHead.ConsumeFlag     = 0U;
             this.parentForm.writeCard(consumeCardEntity.getEntity());
             WMMessageBox.Show(this, "重置成功!");
         }
     }
 }
Beispiel #4
0
        // Token: 0x0600019F RID: 415 RVA: 0x00006040 File Offset: 0x00004240
        public override uint getCardID(bool silent)
        {
            if (!this.checkDevice(true))
            {
                return(0U);
            }
            byte[] array  = new byte[8];
            byte[] array2 = new byte[4];
            int    num    = (int)QingtongReader.qt_T5557_RegularRead(this.device, 17, 2, array);

            if (num != 0)
            {
                if (!silent)
                {
                    WMMessageBox.Show(this.owner, "无法读取卡片密码!");
                }
                return(0U);
            }
            array2[0] = array[4];
            array2[1] = array[5];
            array2[2] = array[6];
            array2[3] = array[7];
            if (array2 == null)
            {
                return(0U);
            }
            uint[] array3 = base.byte2Uint32(array2);
            if (array3.Length <= 0)
            {
                return(0U);
            }
            return(array3[0]);
        }
Beispiel #5
0
        // Token: 0x06000450 RID: 1104 RVA: 0x000410E0 File Offset: 0x0003F2E0
        private void enterBtn_Click(object sender, EventArgs e)
        {
            this.enterBtn.Enabled = false;
            int num = this.parentForm.isValidCard();

            if (num == 1)
            {
                WMMessageBox.Show(this, "空卡!");
                return;
            }
            if (num != 2)
            {
                WMMessageBox.Show(this, "无效卡!");
                return;
            }
            if (!this.parentForm.isVaildTypeCard(1U))
            {
                WMMessageBox.Show(this, "其他卡类型,请检查重试!");
                return;
            }
            RefundCardEntity refundCardEntity = new RefundCardEntity();

            refundCardEntity.CardHead = this.getCardHeadEntity();
            if (this.parentForm != null)
            {
                this.parentForm.writeCard(refundCardEntity.getEntity());
            }
        }
Beispiel #6
0
 // Token: 0x0600041C RID: 1052 RVA: 0x0003C3A4 File Offset: 0x0003A5A4
 private void readCardBtn_Click(object sender, EventArgs e)
 {
     this.cce = this.parseCard(true);
     if (this.cce != null)
     {
         this.db.AddParameter("userId", string.Concat(this.cce.UserId));
         DataRow dataRow = this.db.ExecuteRow("SELECT * FROM metersTable WHERE meterId=@userId");
         if (dataRow == null)
         {
             WMMessageBox.Show(this, "没有找到相应的表信息!");
             return;
         }
         this.db.AddParameter("permanentUserId", dataRow["permanentUserId"].ToString());
         DataRow dataRow2 = this.db.ExecuteRow("SELECT * FROM usersTable WHERE permanentUserId=@permanentUserId");
         if (dataRow2 == null)
         {
             WMMessageBox.Show(this, "没有找到相应的用户信息!");
             return;
         }
         if (dataRow2["isActive"].ToString() == "2")
         {
             WMMessageBox.Show(this, "用户为注销状态,无法操作!");
             return;
         }
         if (this.cce.DeviceHead.ValveCloseStatusFlag != 1U)
         {
             WMMessageBox.Show(this, "阀门为未关闭状态!");
             return;
         }
         this.displayFields(this.cce);
         this.enterBtn.Enabled = true;
     }
 }
        // Token: 0x060001A6 RID: 422 RVA: 0x00006488 File Offset: 0x00004688
        private void loadUserType()
        {
            DbUtil dbUtil = new DbUtil();

            this.userTypeDataTable  = dbUtil.ExecuteQuery("SELECT * FROM userTypeTable ORDER BY typeId ASC");
            this.priceTypeDataTable = dbUtil.ExecuteQuery("SELECT * FROM priceConsistTable ORDER BY priceConsistId ASC");
            if (this.userTypeDataTable == null || this.userTypeDataTable.Rows == null || this.userTypeDataTable.Rows.Count <= 0)
            {
                WMMessageBox.Show(this, "未找到用户类型,请先增加");
                return;
            }
            List <string> list = new List <string>();

            for (int i = 0; i < this.userTypeDataTable.Rows.Count; i++)
            {
                list.Add(this.userTypeDataTable.Rows[i]["userType"].ToString());
            }
            SettingsUtils.setComboBoxData(list, this.userTypeCB);
            if (this.priceTypeDataTable != null && this.priceTypeDataTable.Rows != null && this.priceTypeDataTable.Rows.Count > 0)
            {
                List <string> list2 = new List <string>();
                for (int j = 0; j < this.priceTypeDataTable.Rows.Count; j++)
                {
                    list2.Add(this.priceTypeDataTable.Rows[j]["priceConstistName"].ToString());
                }
                SettingsUtils.setComboBoxData(list2, this.priceTypeCB);
                return;
            }
            WMMessageBox.Show(this, "未找到价格类型,请先增加");
        }
Beispiel #8
0
        // Token: 0x06000292 RID: 658 RVA: 0x00016420 File Offset: 0x00014620
        private void requestBtn_Click(object sender, EventArgs e)
        {
            DateTime value     = this.dateTimePicker.Value;
            TimeSpan timeSpan  = new DateTime(value.Year, value.Month, value.Day) - WMConstant.DT1970;
            TimeSpan timeSpan2 = new DateTime(value.Year, value.Month, value.Day, 23, 59, 59, 999) - WMConstant.DT1970;
            bool     flag      = true;

            this.db.AddParameter("staffId", MainForm.getStaffId());
            DataRow dataRow = this.db.ExecuteRow("SELECT * FROM staffTable WHERE staffId=@staffId");

            if (dataRow != null)
            {
                ulong num = ConvertUtils.ToUInt64(dataRow["staffRank"].ToString());
                if (num == 0UL)
                {
                    flag = false;
                }
            }
            this.db.AddParameter("startTime", string.Concat(timeSpan.TotalSeconds));
            this.db.AddParameter("endTime", string.Concat(timeSpan2.TotalSeconds));
            this.db.AddParameter("operator", MainForm.getStaffId());
            DataTable dataTable = this.db.ExecuteQuery("SELECT * FROM payLogTable WHERE operateTime>=@startTime AND operateTime<=@endTime" + (flag ? " AND operator=@operator" : ""));

            if (dataTable == null || dataTable.Rows == null || dataTable.Rows.Count <= 0)
            {
                WMMessageBox.Show(this, "没有符合条件的交易!");
                return;
            }
            this.initDGV(dataTable);
        }
Beispiel #9
0
        // Token: 0x060002F4 RID: 756 RVA: 0x0001EC08 File Offset: 0x0001CE08
        private void restoreFile(string file, bool isrewrite)
        {
            string destFileName = ".\\db\\hw_wm.db";

            File.Copy(file, destFileName, isrewrite);
            WMMessageBox.Show(this, "数据库恢复成功!");
        }
        // Token: 0x06000181 RID: 385 RVA: 0x00005A38 File Offset: 0x00003C38
        public override int clearAllData(bool beep, bool initialize)
        {
            if (!this.checkDevice(true))
            {
                return(-2);
            }
            this.pwd = base.getPassword(beep);
            if (this.pwd == null)
            {
                return(-1);
            }
            byte[] data_card = new byte[28];
            int    num       = 0;

            if (!this.isEncryptCard())
            {
                return(0);
            }
            if (!RDIC100Reader.ATA_AccessPWD(0, 1, this.pwd, this.ADDR))
            {
                return(-1);
            }
            int num2 = RDIC100Reader.ATA_ReadCardRF32(data_card, ref num, this.ADDR);

            if (num2 != 1)
            {
                return(-1);
            }
            if (!RDIC100Reader.ATA_ProteWrite(0, 0, 0, new byte[]
            {
                0,
                8,
                128,
                232
            }, this.pwd, this.ADDR))
            {
                return(-1);
            }
            RDIC100Reader.ATA_StandWrite(0, 1, 0, new byte[4], this.ADDR);
            RDIC100Reader.ATA_StandWrite(0, 2, 0, new byte[4], this.ADDR);
            RDIC100Reader.ATA_StandWrite(0, 3, 0, new byte[4], this.ADDR);
            RDIC100Reader.ATA_StandWrite(0, 4, 0, new byte[4], this.ADDR);
            RDIC100Reader.ATA_StandWrite(0, 5, 0, new byte[4], this.ADDR);
            RDIC100Reader.ATA_StandWrite(0, 6, 0, new byte[4], this.ADDR);
            RDIC100Reader.ATA_StandWrite(0, 7, 0, new byte[4], this.ADDR);
            if (!this.isEncryptCard())
            {
                if (beep)
                {
                    RDIC100Reader.gSetBeep(100, this.ADDR);
                }
                if (initialize)
                {
                    this.initializeCard();
                }
                return(0);
            }
            WMMessageBox.Show(this.owner, "清除数据失败,请手工清除!");
            return(-1);
        }
Beispiel #11
0
        // Token: 0x06000167 RID: 359 RVA: 0x00005164 File Offset: 0x00003364
        public override uint getCardID(bool silent)
        {
            if (!this.checkDevice(true))
            {
                return(0U);
            }
            byte[] array  = new byte[8];
            byte[] array2 = new byte[4];
            MHCardReader.E5557_Select_Page(1);
            int num = MHCardReader.E5557_Read_Free(2, array);

            if (num != 0)
            {
                if (!silent)
                {
                    WMMessageBox.Show(this.owner, "无法读取卡片密码!");
                }
                return(0U);
            }
            array2[0] = array[4];
            array2[1] = array[5];
            array2[2] = array[6];
            array2[3] = array[7];
            if (array2 == null)
            {
                return(0U);
            }
            uint[] array3 = base.byte2Uint32(array2);
            if (array3.Length <= 0)
            {
                return(0U);
            }
            return(array3[0]);
        }
        // Token: 0x060004C1 RID: 1217 RVA: 0x0004BEB8 File Offset: 0x0004A0B8
        private void enterBtn_Click(object sender, EventArgs e)
        {
            int num = this.parentForm.isValidCard();

            if (num == 1)
            {
                int num2 = this.parentForm.initializeCard();
                if (num2 == -2 || num2 == -1)
                {
                    WMMessageBox.Show(this, "初始化卡失败,请检查重试!");
                    return;
                }
                this.writeCard();
                return;
            }
            else
            {
                if (num == 2)
                {
                    if (WMMessageBox.Show(this, "是否清除卡中数据?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK && this.parentForm != null)
                    {
                        this.parentForm.clearAllData(false, true);
                        this.writeCard();
                    }
                    return;
                }
                WMMessageBox.Show(this, "无效卡!");
                return;
            }
        }
Beispiel #13
0
        private ConsumeCardEntity parseCard(bool beep)
        {
            uint[] array = readCard(beep);
            this.arrayReadCard = array;
            if (array != null && getCardType(array[0]) == 1U)
            {
                if (getCardAreaId(array[0]).CompareTo(ConvertUtils.ToUInt32(this.areaId, 10)) != 0)
                {
                    WMMessageBox.Show(this, "区域ID不匹配!");
                    this.ReaderOk = false;
                    return(null);
                }
                ConsumeCardEntity consumeCardEntity = new ConsumeCardEntity();
                consumeCardEntity.parseEntity(array);
                DbUtil dbUtil = new DbUtil();
                dbUtil.AddParameter("userId", ConvertUtils.ToInt64(consumeCardEntity.UserId).ToString());
                DataRow dataRow = dbUtil.ExecuteRow("SELECT * FROM cardData WHERE userId=@userId");
                this.cardData = dataRow;
                if (dataRow != null && (ulong)getCardID() != (ulong)(Convert.ToInt64(dataRow[2])))
                {
                    WMMessageBox.Show(this, "此卡为挂失卡或者其他用户卡!");
                    this.ReaderOk = false;
                    return(null);
                }
                return(consumeCardEntity);
            }
            else if (array != null)
            {
                WMMessageBox.Show(this, "此卡为其他卡片类型!");
                this.ReaderOk = false;
            }

            return(null);
        }
 // Token: 0x06000393 RID: 915 RVA: 0x0002961C File Offset: 0x0002781C
 private ConsumeCardEntity parseCard(bool beep)
 {
     if (this.parentForm != null)
     {
         uint[] array = this.parentForm.readCard(beep);
         if (array != null && this.parentForm.getCardType(array[0]) == 1U)
         {
             if (this.parentForm.getCardAreaId(array[0]).CompareTo(ConvertUtils.ToUInt32(this.parentForm.getSettings()[0])) != 0)
             {
                 WMMessageBox.Show(this, "区域ID不匹配!");
                 return(null);
             }
             ConsumeCardEntity consumeCardEntity = new ConsumeCardEntity();
             consumeCardEntity.parseEntity(array);
             this.db.AddParameter("userId", ConvertUtils.ToInt64(consumeCardEntity.UserId).ToString());
             DataRow dataRow = this.db.ExecuteRow("SELECT * FROM cardData WHERE userId=@userId");
             if (dataRow != null && (ulong)this.parentForm.getCardID() != (ulong)(Convert.ToInt64(dataRow[2])))
             {
                 WMMessageBox.Show(this, "此卡为挂失卡或者其他用户卡!");
                 return(null);
             }
             return(consumeCardEntity);
         }
         else if (array != null)
         {
             WMMessageBox.Show(this, "此卡为其他卡片类型!");
         }
     }
     return(null);
 }
 // Token: 0x060003E7 RID: 999 RVA: 0x00034F78 File Offset: 0x00033178
 private void loadData()
 {
     if (this.permanentUserId != null)
     {
         this.db.AddParameter("permanentUserId", this.permanentUserId);
         DataRow dataRow = this.db.ExecuteRow("SELECT * FROM usersTable WHERE permanentUserId=@permanentUserId");
         if (dataRow != null)
         {
             this.userIdTB.Text          = dataRow["userId"].ToString();
             this.nameTB.Text            = dataRow["username"].ToString();
             this.phoneNumTB.Text        = dataRow["phoneNum"].ToString();
             this.identityCardNumTB.Text = dataRow["identityId"].ToString();
             this.addressTB.Text         = dataRow["address"].ToString();
             this.userAreaNumTB.Text     = dataRow["userArea"].ToString();
             this.usrePersonsTB.Text     = dataRow["userPersons"].ToString();
             this.userIdTB.Text          = dataRow["userId"].ToString();
             this.permanentUserIdTB.Text = dataRow["permanentUserId"].ToString();
             this.lastBalance            = (string.IsNullOrEmpty(dataRow["userBalance"].ToString()) ? ConvertUtils.ToDouble(dataRow["userBalance"].ToString()) : 0.0);
         }
         else if (dataRow == null)
         {
             WMMessageBox.Show(this, "没有找到该用户!");
             return;
         }
         if (Convert.ToInt64(dataRow["isActive"]) == 2L)
         {
             WMMessageBox.Show(this, "该用户已销户!");
             return;
         }
         if (Convert.ToInt64(dataRow["isActive"]) == 0L)
         {
             WMMessageBox.Show(this, "该用户未开户!");
             return;
         }
         this.fillBaseInfoWidget(dataRow);
         this.baseInfo = dataRow;
         this.db.AddParameter("userId", dataRow["userId"].ToString());
         DataRow dataRow2 = this.db.ExecuteRow("SELECT * FROM metersTable WHERE meterId=@userId");
         if (dataRow2 == null)
         {
             WMMessageBox.Show(this, "没有找到相应的表信息!");
             return;
         }
         this.db.AddParameter("permanentUserId", dataRow2["permanentUserId"].ToString());
         this.db.AddParameter("operateType1", "2");
         this.db.AddParameter("lastReadInfo", "0");
         DataTable dataTable = this.db.ExecuteQuery("SELECT * FROM userCardLog WHERE permanentUserId=@permanentUserId AND operateType!=@operateType1 AND lastReadInfo=@lastReadInfo ORDER BY operationId DESC");
         if (dataTable != null && dataTable.Rows != null && dataTable.Rows.Count > 0)
         {
             DataRow dr = dataTable.Rows[0];
             this.lastPursuitInfo = dr;
             this.fillPursuitInfoWidget(dr);
             this.enterBtn.Enabled = true;
             return;
         }
         WMMessageBox.Show(this, "没有找到消费记录!");
     }
 }
 // Token: 0x0600031E RID: 798 RVA: 0x00020CDA File Offset: 0x0001EEDA
 private void delAllBtn_Click(object sender, EventArgs e)
 {
     if (this.staffIdTB.Text.Trim() == "1000")
     {
         WMMessageBox.Show(this, "禁止修改超级管理员权限!");
         return;
     }
     this.selectListBox.Items.Clear();
 }
Beispiel #17
0
        // Token: 0x060001CF RID: 463 RVA: 0x00008B40 File Offset: 0x00006D40
        private void readRegisterInfofailed(string info)
        {
            DialogResult dialogResult = WMMessageBox.Show(this, info);

            if (dialogResult == DialogResult.OK)
            {
                Application.Exit();
            }
        }
Beispiel #18
0
        // Token: 0x0600028A RID: 650 RVA: 0x00015AB4 File Offset: 0x00013CB4
        private void registerBtn_Click(object sender, EventArgs e)
        {
            string text = this.registerStringTB.Text.Trim();

            if (text == "")
            {
                WMMessageBox.Show(this, "请输入注册序号!");
                return;
            }
            if (!RegisterUtil.getRegisterResult(this.hardwareInfoTB.Text.Trim(), text))
            {
                WMMessageBox.Show(this, "输入有误,请检查输入注册序号!");
                return;
            }
            DbUtil dbUtil = new DbUtil();

            dbUtil.AddParameter("key", text);
            DataRow dataRow = dbUtil.ExecuteRow("SELECT * FROM histRgTable WHERE `key`=@key");

            if (dataRow != null)
            {
                WMMessageBox.Show(this, "序号已注册,请重新获取!");
                return;
            }
            string str = "1";

            string[] array = text.Split(new char[]
            {
                '-'
            });
            if (array.Length == 6)
            {
                str = array[5];
            }
            uint num = ConvertUtils.ToUInt32(str);

            dbUtil.AddParameter("key", text);
            dbUtil.AddParameter("d", RegisterUtil.GetTimeStamp().ToString());
            dbUtil.AddParameter("ivd", (RegisterUtil.GetTimeStamp() + (ulong)(num * 365U * 24U * 60U * 60U)).ToString());
            dbUtil.AddParameter("code", this.hardwareInfoTB.Text.Trim());
            dbUtil.ExecuteNonQuery("INSERT INTO rgTable(`key`, d, ivd, code) values (@key, @d, @ivd, @code) ON DUPLICATE KEY UPDATE `key`=@key,d=@d,ivd=@ivd");
            dbUtil.AddParameter("key", text);
            dbUtil.AddParameter("d", RegisterUtil.GetTimeStamp().ToString());
            dbUtil.AddParameter("code", this.hardwareInfoTB.Text.Trim());
            dbUtil.ExecuteNonQuery("INSERT INTO histRgTable(`key`, d, `code`) VALUES (@key, @d, @code)");
            dbUtil.AddParameter("key", "1");
            dataRow = dbUtil.ExecuteRow("SELECT * FROM settings WHERE `key`=@key");
            if (dataRow != null)
            {
                ulong num2 = ConvertUtils.ToUInt64(dataRow["totalRegTime"].ToString());
                dbUtil.AddParameter("key", "1");
                dbUtil.AddParameter("totalRegTime", string.Concat(num2 + 1UL));
                dbUtil.ExecuteNonQuery("UPDATE settings SET totalRegTime=@totalRegTime WHERE `key`=@key");
            }
            base.Visible = false;
        }
Beispiel #19
0
        // Token: 0x0600020A RID: 522 RVA: 0x0000BC24 File Offset: 0x00009E24
        private void staffMdifyEnterBtn_Click(object sender, EventArgs e)
        {
            if (this.currentPwdTB.Text == "")
            {
                WMMessageBox.Show(this, "请输入当前密码!");
                return;
            }
            if (this.staffModifyStaffPwdTB.Text == "" || this.staffModifyStaffRePwdTB.Text == "")
            {
                WMMessageBox.Show(this, "请输入所有信息!");
                return;
            }
            if (this.staffModifyStaffPwdTB.Text != this.staffModifyStaffRePwdTB.Text)
            {
                WMMessageBox.Show(this, "请检查确认密码,确保两次输入相同!");
                return;
            }
            DbUtil dbUtil = new DbUtil();

            dbUtil.AddParameter("userId", MainForm.getStaffId());
            DataRow dataRow = dbUtil.ExecuteRow("SELECT * FROM staffTable WHERE staffId=@userId");

            if (dataRow == null)
            {
                WMMessageBox.Show(this, "员工号不存在!");
                return;
            }
            long num = Convert.ToInt64(dataRow[1]);

            if (num != 0L)
            {
                WMMessageBox.Show(this, "员工号为" + WMConstant.StaffStatusList[(int)(checked ((IntPtr)num))] + "状态!");
                return;
            }
            string a  = dataRow[8].ToString();
            string md = SettingsUtils.GetMD5(this.currentPwdTB.Text.Trim());

            if (a != md)
            {
                WMMessageBox.Show(this, "当前密码错误!");
                return;
            }
            dbUtil.AddParameter("staffId", MainForm.getStaffId());
            md = SettingsUtils.GetMD5(this.staffModifyStaffRePwdTB.Text.Trim());
            dbUtil.AddParameter("staffPwd", md);
            int num2 = dbUtil.ExecuteNonQuery("UPDATE staffTable SET staffPwd=@staffPwd WHERE staffId=@staffId");

            if (num2 > 0)
            {
                WMMessageBox.Show(this, "密码修改成功!");
                base.Close();
                return;
            }
            WMMessageBox.Show(this, "密码修改失败!");
        }
Beispiel #20
0
        // Token: 0x0600019B RID: 411 RVA: 0x00005DC8 File Offset: 0x00003FC8
        public override uint[] readCard(bool beep)
        {
            if (!this.checkDevice(true))
            {
                return(null);
            }
            uint num = this.getCardID(false);

            this.pwd = base.getPassword(false, num);
            if (this.pwd == null)
            {
                return(null);
            }
            byte[] array = new byte[28];
            if (QingtongReader.qt_T5557_readm(this.device, 0, 1, array) == 0)
            {
                WMMessageBox.Show(this.owner, "该卡为空白卡,请先初始化!");
                return(null);
            }
            int num2 = (int)QingtongReader.qt_T5557_pwdreadm(this.device, 0, 7, this.pwd, array);

            if (num2 != 0)
            {
                WMMessageBox.Show(this.owner, "读卡错误!");
                return(null);
            }
            if ((int)this.device > 0 && beep)
            {
                QingtongReader.dv_beep(this.device, 10);
            }
            uint[] array2 = base.byte2Uint32(array);
            uint[] array3 = new uint[]
            {
                array2[1],
                array2[2],
                array2[3],
                array2[4],
                array2[5],
                array2[6]
            };
            num = num * ICardReader.DATA_PASS1 + ICardReader.DATA_PASS2;
            for (int i = 0; i < array3.Length; i++)
            {
                array3[i] ^= num;
            }
            CRCUtil crcutil = new CRCUtil(array3);

            if (!crcutil.checkCRC())
            {
                WMMessageBox.Show(this.owner, "CRC检查错误!");
                return(null);
            }
            return(array3);
        }
Beispiel #21
0
        /// <summary>
        /// 退款
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button3_Click(object sender, EventArgs e)
        {
            string refund_request_no = Guid.NewGuid().ToString();

            this.textBox_refund_request_no.Text = refund_request_no;
            string out_order_no      = this.textBox1.Text;
            string amount            = this.textBox2.Text;
            string order_create_time = strToTime(this.textBox3.Text);

            if (string.IsNullOrWhiteSpace(out_order_no) || string.IsNullOrWhiteSpace(amount) || string.IsNullOrWhiteSpace(order_create_time))
            {
                WMMessageBox.Show(this, "请选择退款错误的数据!");
                return;
            }
            double refund_fee   = double.Parse(amount);
            string refundResult = HeMaPay.Refund(out_order_no, refund_request_no, refund_fee, order_create_time);

            if (string.IsNullOrWhiteSpace(refundResult))
            {
                RefundDB(out_order_no, refundResult, "0");
                WMMessageBox.Show(this, "退款失败,请稍后再试!");
                return;
            }
            else
            {
                JObject retRefundObj = JObject.Parse(refundResult);
                if (retRefundObj["code"].ToString().Equals("200"))
                {
                    JObject retRefundDetailObj = JObject.Parse(retRefundObj["data"].ToString());
                    if (retRefundDetailObj["sub_code"].ToString().Equals("REFUND_SUCCESS"))
                    {
                        refundOK(out_order_no, refundResult);
                        cleanData();
                        initDGV();
                        WMMessageBox.Show(this, "退款成功!");
                        return;
                    }
                    else
                    {
                        RefundDB(out_order_no, refundResult, "0");
                        showCauseOfError(retRefundDetailObj);
                        WMMessageBox.Show(this, "退款失败!");
                        return;
                    }
                }
                else
                {
                    RefundDB(out_order_no, refundResult, "0");
                    showCauseOfError(retRefundObj);
                    WMMessageBox.Show(this, "退款失败!");
                    return;
                }
            }
        }
Beispiel #22
0
 // Token: 0x06000198 RID: 408 RVA: 0x00005CAC File Offset: 0x00003EAC
 public override bool checkDevice(bool showDialog)
 {
     if ((int)this.device < 0)
     {
         if (showDialog)
         {
             WMMessageBox.Show(this.owner, "读卡器设备没有初始化!");
         }
         return(false);
     }
     return(true);
 }
Beispiel #23
0
        // Token: 0x060002F3 RID: 755 RVA: 0x0001EBCC File Offset: 0x0001CDCC
        private void saveFile(string file, bool isrewrite)
        {
            string text = ".\\db\\hw_wm.db";

            if (!File.Exists(text))
            {
                WMMessageBox.Show(this, "源数据库不存在!");
                return;
            }
            File.Copy(text, file, isrewrite);
            WMMessageBox.Show(this, "数据库备份成功!");
        }
Beispiel #24
0
        // Token: 0x0600042C RID: 1068 RVA: 0x0003DB10 File Offset: 0x0003BD10
        private void fillAllWidget(string id)
        {
            if (id == null || id == "")
            {
                return;
            }
            this.db.AddParameter("userId", id);
            DataRow dataRow = this.db.ExecuteRow("SELECT * FROM metersTable WHERE meterId=@userId");

            if (dataRow == null)
            {
                WMMessageBox.Show(this, "没有找到相应的表信息!");
                return;
            }
            this.db.AddParameter("permanentUserId", dataRow["permanentUserId"].ToString());
            DataRow dataRow2 = this.db.ExecuteRow("SELECT * FROM usersTable WHERE permanentUserId=@permanentUserId");

            if (dataRow2 != null)
            {
                string a = dataRow2["isActive"].ToString();
                if (a == "2")
                {
                    WMMessageBox.Show(this, "用户为注销状态,无法修改!");
                    return;
                }
                this.nameTB.Text            = dataRow2["username"].ToString();
                this.phoneNumTB.Text        = dataRow2["phoneNum"].ToString();
                this.identityCardNumTB.Text = dataRow2["identityId"].ToString();
                this.addressTB.Text         = dataRow2["address"].ToString();
                this.userAreaNumTB.Text     = dataRow2["userArea"].ToString();
                this.usrePersonsTB.Text     = dataRow2["userPersons"].ToString();
                this.userIdTB.Text          = dataRow2["userId"].ToString();
                this.permanentUserIdTB.Text = dataRow2["permanentUserId"].ToString();
                string value  = dataRow2["userTypeId"].ToString();
                string value2 = dataRow2["userPriceConsistId"].ToString();
                this.db.AddParameter("userTypeId", value);
                DataRow dataRow3 = this.db.ExecuteRow("SELECT * FROM userTypeTable WHERE typeId=@userTypeId");
                if (dataRow3 != null)
                {
                    string text = dataRow3["userType"].ToString();
                    this.userTypeTB.Text = text;
                }
                this.db.AddParameter("priceConsistId", value2);
                dataRow3 = this.db.ExecuteRow("SELECT * FROM priceConsistTable WHERE priceConsistId=@priceConsistId");
                if (dataRow3 != null)
                {
                    string text2 = dataRow3["priceConstistName"].ToString();
                    this.priceTypeTB.Text = text2;
                }
                this.enterBtn.Enabled    = true;
                this.orginalUserIdentity = this.identityCardNumTB.Text;
            }
        }
Beispiel #25
0
        // Token: 0x06000168 RID: 360 RVA: 0x000051E4 File Offset: 0x000033E4
        public override int clearAllData(bool beep, bool initialize)
        {
            if (!this.checkDevice(true))
            {
                return(-2);
            }
            this.pwd = base.getPassword(beep);
            if (this.pwd == null)
            {
                return(-1);
            }
            byte[] array = new byte[28];
            MHCardReader.E5557_Select_Page(0);
            int num = MHCardReader.E5557_Read_Free(7, array);

            if (num != 0)
            {
                num = MHCardReader.E5557_Direct_Read(0, 0, 1, this.pwd, array);
                if (array[0] != 0 || array[1] != 8 || array[2] != 128 || array[3] != 56 || num != 0)
                {
                    return(-1);
                }
                byte[] data = new byte[]
                {
                    0,
                    8,
                    128,
                    232
                };
                num = MHCardReader.E5557_Write_Pwd(0, 0, 0, this.pwd, data);
            }
            if (num == 0)
            {
                num = MHCardReader.E5557_Write_Free(0, 1, 0, new byte[4]) + MHCardReader.E5557_Write_Free(0, 2, 0, new byte[4]) + MHCardReader.E5557_Write_Free(0, 3, 0, new byte[4]) + MHCardReader.E5557_Write_Free(0, 4, 0, new byte[4]) + MHCardReader.E5557_Write_Free(0, 5, 0, new byte[4]) + MHCardReader.E5557_Write_Free(0, 6, 0, new byte[4]) + MHCardReader.E5557_Write_Free(0, 7, 0, new byte[4]);
            }
            MHCardReader.E5557_Select_Page(0);
            if (MHCardReader.E5557_Read_Free(7, array) == 0)
            {
                if (beep)
                {
                    MHCardReader.Beep_Option();
                }
                MHCardReader.Led_Option();
                if (initialize)
                {
                    this.initializeCard();
                }
                return(0);
            }
            WMMessageBox.Show(this.owner, "清除数据失败,请手工清除!");
            return(-1);
        }
Beispiel #26
0
 private double getPriceConsistValue()
 {
     if (this.priceConsistRow == null)
     {
         WMMessageBox.Show(this, "未找到价格类型");
         return(0.0);
     }
     if (this.priceConsistRow["calAsArea"].ToString() == "0")
     {
         return(ConvertUtils.ToDouble(this.priceConsistRow["priceConstistValue"].ToString()));
     }
     return(ConvertUtils.ToDouble(this.priceConsistRow["priceConstistValue"].ToString()) * ConvertUtils.ToDouble(userAreaNumTBText));
 }
Beispiel #27
0
 private bool checkOtherStatus(ConsumeCardEntity cce)
 {
     if (cce != null && cce.DeviceHead.BatteryStatus == 1U)
     {
         WMMessageBox.Show(this, "注意 : 表电池电量低!");
         return(true);
     }
     if (cce != null && cce.DeviceHead.ValveStatus == 1U)
     {
         WMMessageBox.Show(this, "注意 : 阀门坏!");
         return(true);
     }
     return(true);
 }
Beispiel #28
0
        private void button1_Click(object sender, EventArgs e)
        {
            string acc = this.textBox1.Text;

            if (acc == "")
            {
                WMMessageBox.Show(this, "请输入员工号!");
                return;
            }
            string pwd = this.textBox2.Text;

            if (pwd == "")
            {
                WMMessageBox.Show(this, "请输入密码!");
                return;
            }

            DbUtil dbUtil = new DbUtil();

            dbUtil.AddParameter("userId", acc);
            DataRow dataRow = dbUtil.ExecuteRow("SELECT * FROM staffTable WHERE staffId=@userId");

            if (dataRow == null)
            {
                this.messageHintLabel.Visible = true;
                this.messageHintLabel.Text    = "员工号不存在!";
                return;
            }
            long num = Convert.ToInt64(dataRow[1]);

            if (num != 0L)
            {
                this.messageHintLabel.Visible = true;
                this.messageHintLabel.Text    = "员工号为" + WMConstant.StaffStatusList[(int)(checked ((IntPtr)num))] + "状态!";
                return;
            }
            string a  = dataRow[8].ToString();
            string md = SettingsUtils.GetMD5(pwd);

            if (a != md)
            {
                this.messageHintLabel.Visible = true;
                this.messageHintLabel.Text    = "员工号或密码错误!";
                return;
            }

            Program.loginSign = 1;
            Program.staffId   = acc;
            this.Close();
        }
        // Token: 0x0600031C RID: 796 RVA: 0x00020C40 File Offset: 0x0001EE40
        private void delBtn_Click(object sender, EventArgs e)
        {
            if (this.staffIdTB.Text.Trim() == "1000")
            {
                WMMessageBox.Show(this, "禁止修改超级管理员权限!");
                return;
            }
            PermissionItemEntity permissionItemEntity = (PermissionItemEntity)this.selectListBox.SelectedItem;

            if (permissionItemEntity != null && this.selectListBox.Items.Contains(permissionItemEntity))
            {
                this.selectListBox.Items.Remove(permissionItemEntity);
            }
        }
 // Token: 0x06000394 RID: 916 RVA: 0x00029718 File Offset: 0x00027918
 private void refundReadCardBtn_Click(object sender, EventArgs e)
 {
     this.cce = this.parseCard(true);
     if (this.cce != null)
     {
         if (this.cce.DeviceHead.ConsumeFlag == 1U)
         {
             WMMessageBox.Show(this, "此卡已刷卡!");
             return;
         }
         string value = string.Concat(this.cce.UserId);
         this.db.AddParameter("userId", value);
         DataRow dataRow = this.db.ExecuteRow("SELECT * FROM metersTable WHERE meterId=@userId");
         if (dataRow == null)
         {
             WMMessageBox.Show(this, "没有找到相应的表信息!");
             return;
         }
         this.db.AddParameter("permanentUserId", dataRow["permanentUserId"].ToString());
         DataRow dataRow2 = this.db.ExecuteRow("SELECT * FROM usersTable WHERE permanentUserId=@permanentUserId");
         if (dataRow2 == null)
         {
             WMMessageBox.Show(this, "没有找到该用户!");
             return;
         }
         this.balance = ConvertUtils.ToDouble(dataRow2["userBalance"].ToString());
         this.fillAllRefundTabPageWidget(dataRow2);
         this.db.AddParameter("permanentUserId", dataRow["permanentUserId"].ToString());
         this.db.AddParameter("operateType1", "2");
         this.db.AddParameter("lastReadInfo", "0");
         DataTable dataTable = this.db.ExecuteQuery("SELECT * FROM userCardLog WHERE permanentUserId=@permanentUserId AND operateType!=@operateType1 AND lastReadInfo=@lastReadInfo ORDER BY operationId DESC");
         if (dataTable == null || dataTable.Rows == null || dataTable.Rows.Count <= 0)
         {
             WMMessageBox.Show(this, "没有找到消费记录!");
             return;
         }
         this.lastPursuitInfo = dataTable.Rows[0];
         if (this.lastPursuitInfo["operateType"].ToString() == "3" || this.lastPursuitInfo["operateType"].ToString() == "4")
         {
             WMMessageBox.Show(this, "用户已退购或最后一次购买已取消交易!");
             return;
         }
         double num = ConvertUtils.ToDouble(this.lastPursuitInfo["unitPrice"].ToString());
         this.unitPriceTB.Text = num.ToString("0.00");
         this.balanceTB.Text   = ConvertUtils.ToDouble(dataRow2["userBalance"].ToString()).ToString("0.00");
         this.refundNumTB.Text = ConvertUtils.ToDouble(this.lastPursuitInfo["totalPayNum"].ToString()).ToString("0.00");
         this.calculateTotalFee();
         this.refundEnterBtn.Enabled = true;
     }
 }