Ejemplo n.º 1
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     if (this.textBoxNewName.Text.Trim() == "")
     {
         this.lblTip.Text = "用户名不能为空!";
         this.ReInputName();
     }
     else if ((this.mUserRealName != this.textBoxNewName.Text.Trim()) && this.userDAL.ExistUserName(this.textBoxNewName.Text.Trim()))
     {
         this.lblTip.Text = "此用户名已存在,请重新输入!";
         this.ReInputName();
     }
     else if (this.textBoxNewPwd.Text != this.textBoxReNewPwd.Text)
     {
         this.lblTip.Text = "新输入密码不匹配,请重新输入!";
         this.ReInputPwd();
     }
     else if (GetLength(this.textBoxNewPwd.Text.Trim()) < 4)
     {
         this.lblTip.Text = "密码长度至少4位";
         this.ReInputPwd();
     }
     else if (this.userDAL.UpdateUserNamePwd(this.mUserCode, this.textBoxNewName.Text.Trim(), MD5_Crypt.GetHashStr(this.textBoxNewPwd.Text.Trim())) != -1)
     {
         if ((this.textBoxOldName.Text.Trim() != this.textBoxNewName.Text.Trim()) || (this.mOldPwd != MD5_Crypt.GetHashStr(this.textBoxNewPwd.Text.Trim())))
         {
             MD5_Crypt.GetHashStr(this.textBoxNewPwd.Text.Trim());
             UserLoginUtil.ChangeRemaindNameAndPassword(this.textBoxOldName.Text.Trim(), this.textBoxNewName.Text.Trim(), this.textBoxNewPwd.Text.Trim());
             PropertyUtil.Save();
         }
         MessageManager.ShowMsgBox("INP-131203");
         base.DialogResult = DialogResult.OK;
     }
 }
Ejemplo n.º 2
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     if (MD5_Crypt.GetHashStr(this.textBoxOldPwd.Text.Trim()) != this.mOldPwd)
     {
         this.lblTip.Text      = "当前密码输入错误,请重新输入!";
         this.lblTip.ForeColor = Color.Red;
         this.textBoxOldPwd.Focus();
         this.textBoxOldPwd.SelectAll();
     }
     else if (this.textBoxNewPwd.Text != this.textBoxReNewPwd.Text)
     {
         this.lblTip.Text = "新输入密码不匹配,请重新输入!";
         this.ReInputPwd();
     }
     else if (GetLength(this.textBoxNewPwd.Text.Trim()) < 4)
     {
         this.lblTip.Text = "密码长度至少4位";
         this.ReInputPwd();
     }
     else
     {
         RoleUserDAL rdal = new RoleUserDAL();
         if (rdal.UpdateUserPwd(this.mUserCode, MD5_Crypt.GetHashStr(this.textBoxNewPwd.Text.Trim())) != -1)
         {
             if (this.mOldPwd != MD5_Crypt.GetHashStr(this.textBoxNewPwd.Text.Trim()))
             {
                 UserLoginUtil.UpdateRemaindPasswrodByName(rdal.SelectUserByDM(this.mUserCode).RealName);
                 PropertyUtil.Save();
             }
             MessageManager.ShowMsgBox("INP-132201");
             base.DialogResult = DialogResult.OK;
         }
     }
 }
Ejemplo n.º 3
0
        public static DockForm RunCommand(byte[] value)
        {
            string str = "Aisino.Fwkp.Invoice.ActiveX.TaxCardQuery_Status";

            byte[] bytes            = ToolUtil.GetBytes(MD5_Crypt.GetHashStr(str));
            byte[] destinationArray = new byte[0x20];
            Array.Copy(bytes, 0, destinationArray, 0, 0x20);
            byte[] buffer3 = new byte[0x10];
            Array.Copy(bytes, 0x20, buffer3, 0, 0x10);
            DateTime time = DateTime.Parse(ToolUtil.GetString(AES_Crypt.Decrypt(value, destinationArray, buffer3, null)));
            DateTime now  = DateTime.Now;

            if ((time.CompareTo(now) > 0) || (time.CompareTo(now.AddSeconds(-1.0)) < 0))
            {
                return(null);
            }
            WaitForm form = new WaitForm {
                StartPosition = FormStartPosition.CenterScreen,
                ShowInTaskbar = false
            };

            form.Show();
            bool flag = form.DataCheck();

            form.Close();
            if (!flag)
            {
                return(null);
            }
            if (form.bIsNeedRepair)
            {
                MessageManager.ShowMsgBox("INP-253207", new string[] { form.strRet });
            }
            return(new InvoiceReportForm());
        }
Ejemplo n.º 4
0
        public static BaseForm RunCommand(byte[] value)
        {
            string str = "Aisino.Fwkp.Invoice.ActiveX.TaxCardQuery_Year";

            byte[] bytes            = ToolUtil.GetBytes(MD5_Crypt.GetHashStr(str));
            byte[] destinationArray = new byte[0x20];
            Array.Copy(bytes, 0, destinationArray, 0, 0x20);
            byte[] buffer3 = new byte[0x10];
            Array.Copy(bytes, 0x20, buffer3, 0, 0x10);
            DateTime time = DateTime.Parse(ToolUtil.GetString(AES_Crypt.Decrypt(value, destinationArray, buffer3, null)));
            DateTime now  = DateTime.Now;

            if ((time.CompareTo(now) <= 0) && (time.CompareTo(now.AddSeconds(-1.0)) >= 0))
            {
                if (taxcardEntityBLL.IsLocked())
                {
                    MessageManager.ShowMsgBox("INP-253109");
                    return(null);
                }
                DataSumForm form = new DataSumForm(false)
                {
                    StartPosition            = FormStartPosition.CenterScreen,
                    ShowInTaskbar            = false,
                    strLabelYearOrStartMonth = "起始月份",
                    strLabelEndMonth         = "结束月份",
                    bLabelTaxPeriod          = false,
                    bComboxTaxPeriod         = false
                };
                if (form.ShowDialog() == DialogResult.OK)
                {
                    TaxDateSegment segment = new TaxDateSegment();
                    try
                    {
                        segment.m_nYear       = form.nTaxYear;
                        segment.m_nStartMonth = form.nStartMonth;
                        segment.m_nEndMonth   = form.nEndMonth;
                        segment.m_nTaxPeriod  = Convert.ToInt32(form.strTaxPeriod);
                        return(new InvStatForm(segment, true)
                        {
                            Text = form.strDlgTitle, m_strTitle = form.strLabelTitle
                        });
                    }
                    catch (Exception exception)
                    {
                        MessageManager.ShowMsgBox("INP-253107", new string[] { exception.Message });
                        return(null);
                    }
                }
            }
            return(null);
        }
Ejemplo n.º 5
0
 private void textBoxOldPwd_TextChanged(object sender, EventArgs e)
 {
     if (MD5_Crypt.GetHashStr(this.textBoxOldPwd.Text.Trim()) == this.mOldPwd)
     {
         this.textBoxNewName.ReadOnly  = false;
         this.textBoxNewPwd.ReadOnly   = false;
         this.textBoxReNewPwd.ReadOnly = false;
         this.btnOK.Enabled            = true;
     }
     else
     {
         this.textBoxNewName.ReadOnly  = true;
         this.textBoxNewPwd.ReadOnly   = true;
         this.textBoxReNewPwd.ReadOnly = true;
         this.btnOK.Enabled            = false;
     }
 }
Ejemplo n.º 6
0
 public bool IsMatch(string strName, string strPasswd)
 {
     try
     {
         string   hashStr  = MD5_Crypt.GetHashStr(strPasswd);
         object[] objArray = ServiceFactory.InvokePubService("Aisino.Fwkp.Xtgl.UserPwdService", new object[] { strName, hashStr });
         if (objArray != null)
         {
             return((objArray.Length == 1) && Convert.ToBoolean(objArray[0]));
         }
     }
     catch (Exception exception)
     {
         ExceptionHandler.HandleError(exception);
         return(false);
     }
     return(false);
 }
Ejemplo n.º 7
0
        private Assembly method_0(string string_0)
        {
            string hashStr = MD5_Crypt.GetHashStr(string_0);

            hashStr = hashStr.Substring(0, hashStr.IndexOf("=")) + ".dll";
            Assembly assembly = null;

            if (!dictionary_1.TryGetValue(hashStr, out assembly))
            {
                if (!System.IO.File.Exists(hashStr))
                {
                    WebClient                  client             = new WebClient();
                    ServiceDescription         serviceDescription = ServiceDescription.Read(client.OpenRead(string_0));
                    ServiceDescriptionImporter importer           = new ServiceDescriptionImporter {
                        ProtocolName          = "Soap",
                        Style                 = ServiceDescriptionImportStyle.Client,
                        CodeGenerationOptions = CodeGenerationOptions.GenerateNewAsync | CodeGenerationOptions.GenerateProperties
                    };
                    importer.AddServiceDescription(serviceDescription, null, null);
                    CodeNamespace   namespace2      = new CodeNamespace("Aisino.Framework");
                    CodeCompileUnit codeCompileUnit = new CodeCompileUnit();
                    codeCompileUnit.Namespaces.Add(namespace2);
                    importer.Import(namespace2, codeCompileUnit);
                    CodeDomProvider    provider = CodeDomProvider.CreateProvider("CSharp");
                    CompilerParameters options  = new CompilerParameters {
                        GenerateExecutable = false,
                        OutputAssembly     = hashStr
                    };
                    options.ReferencedAssemblies.Add("System.dll");
                    options.ReferencedAssemblies.Add("System.XML.dll");
                    options.ReferencedAssemblies.Add("System.Web.Services.dll");
                    options.ReferencedAssemblies.Add("System.Data.dll");
                    if (provider.CompileAssemblyFromDom(options, new CodeCompileUnit[] { codeCompileUnit }).Errors.HasErrors)
                    {
                        throw new Exception("客户端代理编译失败");
                    }
                }
                assembly = Assembly.LoadFrom(hashStr);
                dictionary_1[hashStr] = assembly;
            }
            return(assembly);
        }
Ejemplo n.º 8
0
        internal bool SetAdminAndPwd(string strAdminName, string strPwd)
        {
            Dictionary <string, object> dictionary = new Dictionary <string, object>();

            dictionary.Add("DM", "admin");
            dictionary.Add("ZSXM", strAdminName);
            dictionary.Add("MM", MD5_Crypt.GetHashStr(strPwd));
            try
            {
                if (1 == this.baseDAO.updateSQL("Aisino.Fwkp.Xtsz.SetAdminAndPwd", dictionary))
                {
                    return(true);
                }
            }
            catch
            {
                throw;
            }
            this.loger.Error("初始化-设置主管名称密码异常");
            return(false);
        }
Ejemplo n.º 9
0
        public User GetUser()
        {
            User user = new User();

            user = new User {
                RealName    = this.txtName.Text.Trim(),
                Password    = MD5_Crypt.GetHashStr(this.txtPwd.Text.Trim()),
                Telephone   = this.txtPhone.Text.Trim(),
                CreateDate  = DateTime.Now,
                Description = this.txtDescription.Text.Trim()
            };
            user.Code = user.RealName.GetHashCode().ToString();
            foreach (object obj2 in this.chklRole.CheckedItems)
            {
                if (obj2 is Role)
                {
                    user.RoleList.Add((Role)obj2);
                }
            }
            return(user);
        }
Ejemplo n.º 10
0
 internal void ConnectServer()
 {
     try
     {
         if (((this.client == null) || !this.client.ServerPoint.Address.ToString().Equals(Config.serverIP)) || (this.client.ServerPoint.Port != int.Parse(Config.serverPort)))
         {
             this.client = new MyUdpClient(Config.serverIP, int.Parse(Config.serverPort), int.Parse(Config.clientPort));
             this.client.MaxConnWaitTime  = int.Parse(Config.maxConnWaitTime);
             this.client.LoginOKEvent    += Login;
             this.client.ReceiveMsgEvent += getMess;
             this.client.StopEvent       += stopMess;
             this.client.ReConnectEvent  += ReConnectServer;
         }
         if (!this.client.IsConnected)
         {
             this.client.Connect(this.userName, this.userID + "." + MD5_Crypt.GetHashString32(this.userID + "saxiTAO"), Config.maxMessID);
         }
     }
     catch (Exception exception)
     {
         this.log.ErrorFormat("登录公告服务器异常:{0}", exception.ToString());
     }
 }
Ejemplo n.º 11
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     if (this.txtPwd.Text.Trim().Length > 0x10)
     {
         MessageBoxHelper.Show("口令长度不能超过16位,请重新输入!", "系统登录", MessageBoxButtons.OK, MessageBoxIcon.Hand);
         this.txtPwd.Focus();
     }
     else
     {
         bool flag = false;
         this.lblStatus.Text = "正在校验用户名/密码...";
         this.lblStatus.Refresh();
         string str  = this.cmbName.SelectedItem.ToString();
         string str2 = this.txtPwd.Text.Trim();
         if (string.IsNullOrEmpty(this.txtCertPassword.Text.Trim()))
         {
             MessageBoxHelper.Show("证书口令不能为空,请输入!", "登录错误", MessageBoxButtons.OK, MessageBoxIcon.Hand);
         }
         else
         {
             string     hashStr    = MD5_Crypt.GetHashStr(str2);
             Interface0 interface2 = new Class2();
             try
             {
                 flag = interface2.imethod_1(str, hashStr);
             }
             catch (Exception exception)
             {
                 MessageBoxHelper.Show("数据库连接异常", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                 ilog_0.Error(exception.ToString());
                 this.lblStatus.Text = "";
                 return;
             }
             if (flag)
             {
                 this.string_0 = str;
                 this.string_2 = str2;
                 this.string_1 = this.txtCertPassword.Text.Trim();
                 if (this.aisinoCHK_0.Checked)
                 {
                     this.bool_0 = true;
                     PropertyUtil.SetValue("Login_" + BitConverter.ToString(ToolUtil.GetBytes(str)).Replace("-", ""), str2 + "-" + this.string_1);
                 }
                 else
                 {
                     PropertyUtil.SetValue("Login_" + BitConverter.ToString(ToolUtil.GetBytes(str)).Replace("-", ""), string.Empty);
                 }
                 base.DialogResult = DialogResult.OK;
                 base.Dispose();
             }
             else
             {
                 ilog_0.Error("用户/密码错误!");
                 MessageBoxHelper.Show("密码错误,请重新输入!", "登录错误", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                 this.txtPwd.Text = "";
                 this.txtPwd.Focus();
                 this.lblStatus.Text = "";
                 this.lblStatus.Refresh();
             }
         }
     }
 }
Ejemplo n.º 12
0
        public Fpxx BlankWasteTaxCardZuoFei(object[] param)
        {
            string str  = param[0].ToString();
            string str2 = param[1].ToString();
            string str3 = param[2].ToString();
            string str4 = param[3].ToString();
            string str5 = param[4].ToString();
            string str6 = param[5].ToString();
            string code = "0000";

            byte[] sourceArray      = Invoice.TypeByte;
            byte[] destinationArray = new byte[0x20];
            Array.Copy(sourceArray, 0, destinationArray, 0, 0x20);
            byte[] buffer3 = new byte[0x10];
            Array.Copy(sourceArray, 0x20, buffer3, 0, 0x10);
            byte[] buffer4 = AES_Crypt.Encrypt(Encoding.Unicode.GetBytes("KP" + DateTime.Now.ToString("F")), destinationArray, buffer3);
            Invoice.IsGfSqdFp_Static = false;
            Invoice invoice = new Invoice(Invoice.ParseFPLX(str), str2, str3, str4, str5, str6, buffer4, "NEW76mmX177mm");

            invoice.Hjje = "0.00";
            invoice.Hjse = "0.00";
            Fpxx fpData = invoice.GetFpData();

            code = invoice.GetCode();
            if (fpData == null)
            {
                MessageManager.ShowMsgBox(invoice.GetCode(), invoice.Params);
                return(fpData);
            }
            fpData.hzfw = (TaxCardFactory.CreateTaxCard().StateInfo.CompanyType != 0) || (fpData.hxm.Length > 0);
            fpData.sLv  = "0.17";
            string str8 = "Aisino.Fwkp.Invoice" + invoice.Fpdm + invoice.Fphm;

            byte[] bytes = Encoding.Unicode.GetBytes(MD5_Crypt.GetHashStr(str8));
            destinationArray = new byte[0x20];
            Array.Copy(bytes, 0, destinationArray, 0, 0x20);
            buffer3 = new byte[0x10];
            Array.Copy(bytes, 0x20, buffer3, 0, 0x10);
            byte[] inArray = AES_Crypt.Encrypt(Encoding.Unicode.GetBytes(DateTime.Now.ToString("F")), destinationArray, buffer3);
            fpData.gfmc = Convert.ToBase64String(AES_Crypt.Encrypt(Encoding.Unicode.GetBytes(Convert.ToBase64String(inArray) + ";" + invoice.Gfmc), destinationArray, buffer3));
            fpData.zfbz = true;
            fpData.bszt = 0;
            if ((int)fpData.fplx == 12)
            {
                fpData.clsbdh = "0";
                fpData.zyspsm = "#%";
                fpData.zyspmc = "";
            }
            fpData.dy_mb = "NEW76mmX177mm";
            if (!invoice.MakeCardInvoice(fpData, false))
            {
                code = invoice.GetCode();
                if (code.StartsWith("TCD_768") || code.StartsWith("TCD_769"))
                {
                    FormMain.CallUpload();
                }
                MessageManager.ShowMsgBox(invoice.GetCode(), invoice.Params);
                return(fpData);
            }
            code = "0000";
            return(fpData);
        }
Ejemplo n.º 13
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     if (this.txtPwd.Text.Trim().Length > 0x10)
     {
         MessageBoxHelper.Show("用户密码长度不能超过16位,请重新输入!", "系统登录", MessageBoxButtons.OK, MessageBoxIcon.Hand);
         this.txtPwd.Focus();
     }
     else
     {
         bool   flag = false;
         string str3 = this.cmbName.SelectedItem.ToString();
         string str  = this.txtPwd.Text.Trim();
         if (str == this.string_3)
         {
             str = "";
         }
         this.string_1 = this.txtCertPassword.Text.Trim();
         if (this.taxCard_0.SoftVersion != "FWKP_V2.0_Svr_Client")
         {
             if (this.string_1 == this.string_4)
             {
                 this.string_1 = "";
             }
             if (string.IsNullOrEmpty(this.string_1))
             {
                 MessageBoxHelper.Show("证书口令不能为空,请输入!", "登录错误", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                 return;
             }
             if (this.string_1.Length < 8)
             {
                 MessageBoxHelper.Show("证书口令长度不足8位,请重新输入!", "登录错误", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                 return;
             }
             if (this.string_1.Length > 0x10)
             {
                 MessageBoxHelper.Show("证书口令长度不能大于16位,请重新输入!", "登录错误", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                 return;
             }
         }
         string     hashStr    = MD5_Crypt.GetHashStr(str);
         Interface0 interface2 = new Class11();
         try
         {
             flag = interface2.imethod_1(str3, hashStr);
         }
         catch (Exception exception)
         {
             MessageBoxHelper.Show("数据库连接异常", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
             ilog_0.Error(exception.ToString());
             return;
         }
         if (flag)
         {
             this.string_0           = str3;
             this.string_2           = str;
             this.taxCard_0.String_0 = this.string_1;
             if (this.aisinoCHK_0.Checked)
             {
                 this.bool_1 = true;
                 PropertyUtil.SetValue("Login_" + BitConverter.ToString(ToolUtil.GetBytes(str3)).Replace("-", ""), str + "-" + this.string_1);
             }
             else
             {
                 PropertyUtil.SetValue("Login_" + BitConverter.ToString(ToolUtil.GetBytes(str3)).Replace("-", ""), string.Empty);
             }
             if (string.Equals(this.taxCard_0.SoftVersion, "FWKP_V2.0_Svr_Client"))
             {
                 PropertyUtil.SetValue("KPS_PROXY_URL", this.string_1);
             }
             base.DialogResult = DialogResult.OK;
             base.Dispose();
         }
         else
         {
             ilog_0.Error("用户/密码错误!");
             MessageBoxHelper.Show("密码错误,请重新输入!", "登录错误", MessageBoxButtons.OK, MessageBoxIcon.Hand);
             this.method_6("");
             this.txtPwd.Focus();
         }
     }
 }
Ejemplo n.º 14
0
        public bool WasteHard(string strInvType, string strInvCode, string strInvNum)
        {
            string str  = this.taxCard.GetCardClock().ToString();
            FPLX   fplx = 2;

            if (strInvType == "c")
            {
                fplx = 2;
            }
            else if (strInvType == "s")
            {
                fplx = 0;
            }
            else if (strInvType == "f")
            {
                fplx = 11;
            }
            else if (strInvType == "j")
            {
                fplx = 12;
            }
            InvoiceType       invType = (InvoiceType)CommonTool.GetInvType(strInvType);
            InvoiceDataDetail detail  = this.fpzfDAL.GetInvInfo(strInvType, strInvCode, strInvNum);
            string            str2    = strInvCode;
            string            str3    = strInvNum;
            string            str4    = detail.m_dtInvDate.ToString();

            if (detail.m_strBuyerCode.Length == 0)
            {
                return(false);
            }
            string dbAmount = detail.m_dbAmount;

            dbAmount = (dbAmount == "") ? "0.00" : dbAmount;
            string dbTaxRate = "0.00";

            if (detail.m_dbTaxRate.Length == 0)
            {
                if (fplx == 11)
                {
                    dbTaxRate = "0.05";
                }
                else
                {
                    dbTaxRate = "0.04";
                }
            }
            else
            {
                dbTaxRate = detail.m_dbTaxRate;
            }
            string dbTax = detail.m_dbTax;

            dbTax = (dbTax == "") ? "0.00" : dbTax;
            string strBuyerName = detail.m_strBuyerName;

            strBuyerName = (strBuyerName == "") ? " " : strBuyerName;
            byte[] sourceArray      = Invoice.get_TypeByte();
            byte[] destinationArray = new byte[0x20];
            Array.Copy(sourceArray, 0, destinationArray, 0, 0x20);
            byte[] buffer3 = new byte[0x10];
            Array.Copy(sourceArray, 0x20, buffer3, 0, 0x10);
            byte[]   buffer4  = AES_Crypt.Encrypt(ToolUtil.GetBytes("KP" + DateTime.Now.ToString("F")), destinationArray, buffer3);
            object[] objArray = new object[] { strInvType, str2, Convert.ToInt32(str3) };
            Fpxx     fpxx     = ServiceFactory.InvokePubService("Aisino.Fwkp.QueryFPXX", objArray)[0] as Fpxx;
            Invoice  invoice  = new Invoice(false, fpxx, buffer4, null);

            invoice.set_Hjje(fpxx.je);
            invoice.set_Hjse(fpxx.se);
            Fpxx fpData = invoice.GetFpData();

            fpData.kprq = fpxx.kprq;
            fpData.sLv  = (detail.m_dbTaxRate.Length == 0) ? "0.00" : fpxx.sLv;
            byte[] bytes   = ToolUtil.GetBytes(MD5_Crypt.GetHashStr("Aisino.Fwkp.Invoice" + invoice.get_Fpdm() + invoice.get_Fphm()));
            byte[] buffer6 = new byte[0x20];
            Array.Copy(bytes, 0, buffer6, 0, 0x20);
            byte[] buffer7 = new byte[0x10];
            Array.Copy(bytes, 0x20, buffer7, 0, 0x10);
            byte[] inArray = AES_Crypt.Encrypt(ToolUtil.GetBytes(DateTime.Now.ToString("F")), buffer6, buffer7);
            fpData.gfmc = Convert.ToBase64String(AES_Crypt.Encrypt(ToolUtil.GetBytes(Convert.ToBase64String(inArray) + invoice.get_Gfmc()), buffer6, buffer7));
            fpData.zfsj = str;
            fpData.zfbz = true;
            fpData.bszt = 0;
            return(invoice.MakeCardInvoice(fpData, true));
        }