Example #1
0
        public static bool AddAreaIDToCusrTBL()
        {
            IBaseDAO baseDAOSQLite = BaseDAOFactory.GetBaseDAOSQLite();

            baseDAOSQLite.Open();
            try
            {
                IKHBM            ikhbm   = new KHBM();
                IXZQYBM          ixzqybm = new XZQYBM();
                List <KHBMModal> list    = ikhbm.SelectKHBM_WJ(1);
                if (list == null)
                {
                    return(false);
                }
                if (0 < list.Count)
                {
                    for (int i = 0; i < list.Count; i++)
                    {
                        KHBMModal modal = list[i];
                        string    sH    = modal.SH;
                        if (sH.Length >= 4)
                        {
                            if (!string.IsNullOrEmpty(sH) && (4 <= sH.Length))
                            {
                                ikhbm.UpdateKHBM_DQBM(modal.BM, sH.Substring(0, 4));
                            }
                            string             strBM = sH.Substring(0, 4);
                            List <XZQYBMModal> list2 = ixzqybm.SelectXZQYBM_BM(strBM);
                            if ((list2 != null) && (0 < list2.Count))
                            {
                                ikhbm.UpdateKHBM_DQMC(modal.BM, list2[0].MC.Trim());
                            }
                        }
                    }
                    PropertyUtil.SetValue(DingYiZhiFuChuan.A6KHMsgWrite, "已经添加地区代码到客户编码表");
                }
                else
                {
                    return(false);
                }
            }
            catch (BaseException exception)
            {
                writeLogfile("Errinfo:" + exception.Message, _Loger);
                _Loger.Error(exception.ToString());
                ExceptionHandler.HandleError(exception);
            }
            catch (Exception exception2)
            {
                writeLogfile("Errinfo:" + exception2.Message, _Loger);
                _Loger.Error(exception2.ToString());
                ExceptionHandler.HandleError(exception2);
            }
            finally
            {
                baseDAOSQLite.Commit();
                baseDAOSQLite.Close();
            }
            return(true);
        }
Example #2
0
        public bool yhzc_contain_slv(string yhzc, string slv, bool ishysy)
        {
            string   str           = "aisino.Fwkp.Bmgl.BMSPFL.SelectYhzcs";
            IBaseDAO baseDAOSQLite = BaseDAOFactory.GetBaseDAOSQLite();
            Dictionary <string, object> dictionary = new Dictionary <string, object>();
            ArrayList list = baseDAOSQLite.querySQL(str, dictionary);

            if (ishysy)
            {
                foreach (Dictionary <string, object> dictionary2 in list)
                {
                    if ((dictionary2["YHZCMC"].ToString() == yhzc) && (dictionary2["SLV"].ToString() == ""))
                    {
                        return(true);
                    }
                }
                return(false);
            }
            slv = ((double.Parse(slv) * 100.0)).ToString() + "%";
            foreach (Dictionary <string, object> dictionary3 in list)
            {
                if ((dictionary3["YHZCMC"].ToString() == yhzc) && (dictionary3["SLV"].ToString() == ""))
                {
                    return(true);
                }
                if ((dictionary3["YHZCMC"].ToString() == yhzc) && dictionary3["SLV"].ToString().Contains(slv))
                {
                    return(true);
                }
            }
            return(false);
        }
Example #3
0
 public DataTable GetData(int year)
 {
     try
     {
         IBaseDAO baseDAOSQLite = BaseDAOFactory.GetBaseDAOSQLite();
         Dictionary <string, object> dictionary = new Dictionary <string, object>();
         string str = year.ToString();
         dictionary.Add("Year", str);
         UserMsg msg = new UserMsg();
         if (msg.IsAdmin)
         {
             dictionary.Add("AdminBz", 1);
         }
         else
         {
             dictionary.Add("AdminBz", 0);
         }
         dictionary.Add("Admin", msg.MC);
         return(baseDAOSQLite.querySQLDataTable("aisino.fwkp.fpkj.YFCX", dictionary));
     }
     catch (BaseException exception)
     {
         this.loger.Error(exception.Message);
         MessageManager.ShowMsgBox(exception.Message);
         return(null);
     }
     catch (Exception exception2)
     {
         this.loger.Error(exception2.Message);
         MessageManager.ShowMsgBox(exception2.Message);
         return(null);
     }
 }
Example #4
0
        private bool isXT(string mc)
        {
            Dictionary <string, object> dictionary = new Dictionary <string, object>();

            dictionary.Add("MC", mc);
            return(BaseDAOFactory.GetBaseDAOSQLite().querySQL("aisino.fwkp.fptk.selectXThash", dictionary).Count > 0);
        }
Example #5
0
 public ServerUP()
 {
     this.string_0   = "0000";
     this.ibaseDAO_0 = BaseDAOFactory.GetBaseDAOSQLite();
     this.class84_0  = new Class84();
     this.taxCard_0  = TaxCard.CreateInstance(CTaxCardType.const_7);
 }
Example #6
0
 public static Dictionary <string, object> GetFPLBBM()
 {
     try
     {
         IBaseDAO baseDAOSQLite = BaseDAOFactory.GetBaseDAOSQLite();
         Dictionary <string, object> dictionary = new Dictionary <string, object>();
         dictionary.Clear();
         foreach (Dictionary <string, object> dictionary2 in baseDAOSQLite.querySQL("aisino.Fwkp.Fplygl.FPLBBM.AllData", dictionary))
         {
             string key  = dictionary2["BM"].ToString().Trim();
             string str2 = dictionary2["MC"].ToString().Trim();
             if (!dictionary.ContainsKey(key))
             {
                 dictionary.Add(key, str2);
             }
         }
         return(dictionary);
     }
     catch (BaseException exception)
     {
         loger.Error(exception.Message);
         ExceptionHandler.HandleError(exception);
         return(null);
     }
     catch (Exception exception2)
     {
         loger.Error(exception2.Message);
         ExceptionHandler.HandleError(exception2);
         return(null);
     }
 }
Example #7
0
 public static void smethod_4()
 {
     try
     {
         if (Class87.list_1.Count >= 1)
         {
             IBaseDAO baseDAOSQLite = BaseDAOFactory.GetBaseDAOSQLite();
             new Dictionary <string, string>();
             TaxCard.CreateInstance(CTaxCardType.const_7);
             List <string> list = new List <string>();
             for (int i = 0; i < Class87.list_1.Count; i++)
             {
                 if (Class87.list_1[i].ContainsKey("BSRZ"))
                 {
                     list.Add("Aisino.Framework.MainForm.UpDown.UpdateBSRZ");
                     Class87.list_1[i]["BSRZ"] = "【" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "】" + Class87.list_1[i]["BSRZ"].ToString();
                     if (Class87.list_1[i]["BSRZ"].ToString().Length > 0xc3)
                     {
                         Class87.list_1[i]["BSRZ"] = Class87.list_1[i]["BSRZ"].ToString().Substring(0, 0xc3);
                     }
                 }
             }
             if (baseDAOSQLite.未确认DAO方法1(list.ToArray(), Class87.list_1) > 0)
             {
                 Class87.list_1.Clear();
             }
         }
     }
     catch (Exception exception)
     {
         Class101.smethod_1("(下载线程)更改发票报送日志出错:" + exception.ToString());
     }
 }
Example #8
0
        private void FormMain_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (!e.Cancel)
            {
                this.bool_3 = true;
                MessageHelper.MsgWait("正在关闭系统,请您耐心等待,不要关闭电源或拔掉金税盘。");
                Thread.Sleep(500);
                try
                {
                    MessageHelper.MsgWait("正在关闭系统,请您耐心等待,不要关闭电源或拔掉金税盘:保存用户信息。");
                    PropertyUtil.Save();
                    if (base.TaxCardInstance.QYLX.ISTDQY)
                    {
                        goto Label_00DA;
                    }
                    MessageHelper.MsgWait("正在关闭系统,请您耐心等待,不要关闭电源或拔掉金税盘:关闭系统执行中的线程。");
                    this.backgroundWorker_0.CancelAsync();
                    this.backgroundWorker_1.CancelAsync();
                    if (!Class87.bool_4)
                    {
                        this.backgroundWorker_2.CancelAsync();
                    }
                    while (!Class87.bool_4)
                    {
                        if ((this.bool_0 && this.bool_1) && this.bool_2)
                        {
                            goto Label_00C3;
                        }
                        Thread.Sleep(0x3e8);
                        continue;
                    }
                    if (this.bool_0 && this.bool_2)
                    {
                        goto Label_00DA;
                    }
                    Thread.Sleep(0x3e8);
Label_00C3:
                    MessageHelper.MsgWait("正在关闭系统,请您耐心等待,不要关闭电源或拔掉金税盘:上传离线发票。");
                    this.class85_0.method_1(true, false);
Label_00DA:
                    MessageHelper.MsgWait("正在关闭系统,请您耐心等待,不要关闭电源或拔掉金税盘:执行数据备份等操作。");
                    if (ExecuteAfterLoadEvent != null)
                    {
                        ExecuteAfterLoadEvent();
                    }
                    MessageHelper.MsgWait("正在关闭系统,请您耐心等待,不要关闭电源或拔掉金税盘:关闭数据库连接。");
                    BaseDAOFactory.GetBaseDAOSQLite().ClearResource();
                    MessageHelper.MsgWait("正在关闭系统,请您耐心等待,不要关闭电源或拔掉金税盘:关闭金税盘。");
                    base.TaxCardInstance.TaxCardClose();
                    Thread.Sleep(500);
                    MessageHelper.MsgWait();
                }
                catch (Exception)
                {
                    Thread.Sleep(500);
                    MessageHelper.MsgWait();
                }
            }
        }
Example #9
0
 public KMProperty()
 {
     try
     {
         this.baseDao = BaseDAOFactory.GetBaseDAOSQLite();
     }
     catch (Exception exception)
     {
         this.loger.Error("发票转凭证错误:" + exception.Message);
     }
 }
Example #10
0
 public DKFP()
 {
     try
     {
         this.baseDao = BaseDAOFactory.GetBaseDAOSQLite();
         this.dict    = new Dictionary <string, object>();
     }
     catch (Exception exception)
     {
         this.loger.Error(exception.Message);
     }
 }
Example #11
0
 private void method_3()
 {
     try
     {
         IBaseDAO baseDAOSQLite = BaseDAOFactory.GetBaseDAOSQLite();
         string   str           = "SELECT * FROM XTBBXX";
         this.dataTable_0 = baseDAOSQLite.querySQLDataTable(str);
     }
     catch (Exception exception)
     {
         this.ilog_0.Error("LoadReginfoFromDB异常:" + exception.ToString());
     }
 }
Example #12
0
 public AisinoDataSet QueryPub(string start, string end, int pageSize, int pageNo)
 {
     try
     {
         Dictionary <string, object> dictionary = new Dictionary <string, object>();
         dictionary.Add("START", start);
         dictionary.Add("END", end);
         this.log.Info("查询公告信息列表");
         return(BaseDAOFactory.GetBaseDAOSQLite().querySQLDataSet("pubQuery", dictionary, pageSize, pageNo));
     }
     catch (Exception exception)
     {
         this.log.Error("查询公告信息列表异常:" + exception.ToString());
         return(null);
     }
 }
Example #13
0
        public bool yhzc_contain_slv(string yhzc, string slv, bool flag, bool isTsfp)
        {
            string   str           = "aisino.fwkp.Wbjk.SelectYhzcs";
            IBaseDAO baseDAOSQLite = BaseDAOFactory.GetBaseDAOSQLite();
            Dictionary <string, object> dictionary = new Dictionary <string, object>();
            ArrayList list = baseDAOSQLite.querySQL(str, dictionary);

            if (isTsfp)
            {
                foreach (Dictionary <string, object> dictionary2 in list)
                {
                    if ((dictionary2["YHZCMC"].ToString() == yhzc) && (dictionary2["SLV"].ToString() == ""))
                    {
                        return(true);
                    }
                }
                return(false);
            }
            if ((slv == "免税") || (slv == "不征税"))
            {
                slv = "0%";
            }
            else if (!flag)
            {
                slv = ((double.Parse(slv) * 100.0)).ToString() + "%";
            }
            foreach (Dictionary <string, object> dictionary2 in list)
            {
                string[] source = dictionary2["SLV"].ToString().Split(new string[] { "、", ",", "," }, StringSplitOptions.RemoveEmptyEntries);
                for (int i = 0; i < source.Length; i++)
                {
                    if (source[i] == "1.5%_5%")
                    {
                        source[i] = "1.5%";
                    }
                }
                if ((dictionary2["YHZCMC"].ToString() == yhzc) && (dictionary2["SLV"].ToString() == ""))
                {
                    return(true);
                }
                if ((dictionary2["YHZCMC"].ToString() == yhzc) && source.Contains <string>(slv))
                {
                    return(true);
                }
            }
            return(false);
        }
Example #14
0
 public HtmlMessage QueryPub(string xh)
 {
     try
     {
         Dictionary <string, object> dictionary = new Dictionary <string, object>();
         dictionary.Add("XH", xh);
         Dictionary <string, object> dictionary2 = BaseDAOFactory.GetBaseDAOSQLite().querySQL("pubQueryOne", dictionary)[0] as Dictionary <string, object>;
         HtmlMessage message = new HtmlMessage(dictionary2["xh"].ToString(), dictionary2["bt"].ToString(), dictionary2["nr"].ToString(), dictionary2["lx"].ToString(), 10);
         this.log.Info("查询公告明细信息");
         return(message);
     }
     catch (Exception exception)
     {
         this.log.Error("查询公告明细信息异常:" + exception.ToString());
         return(null);
     }
 }
Example #15
0
 public SPBM()
 {
     try
     {
         this.baseDao = BaseDAOFactory.GetBaseDAOSQLite();
     }
     catch (BaseException exception)
     {
         this.loger.Error(exception.Message);
         ExceptionHandler.HandleError(exception);
     }
     catch (Exception exception2)
     {
         this.loger.Error(exception2.Message);
         ExceptionHandler.HandleError(exception2);
     }
 }
Example #16
0
 public bool SavePub(HtmlMessage mess)
 {
     try
     {
         Dictionary <string, object> dictionary = new Dictionary <string, object>();
         dictionary.Add("XH", mess.Id);
         dictionary.Add("BT", mess.Title);
         dictionary.Add("NR", mess.Message);
         dictionary.Add("LX", mess.Type);
         int num = BaseDAOFactory.GetBaseDAOSQLite().未确认DAO方法2_疑似updateSQL("pubSave", dictionary);
         this.log.Info("保存公告信息");
         return(num == 1);
     }
     catch (Exception exception)
     {
         this.log.Error("保存公告信息异常:" + exception.ToString());
         return(false);
     }
 }
Example #17
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     try
     {
         if ((this.checkBoxCommSpec.Checked || this.checkBoxTrans.Checked) || this.checkBoxVech.Checked)
         {
             Dictionary <string, object> dictionary = new Dictionary <string, object>();
             dictionary.Add("BeginTime", this.dateTimePickerBegin.Text);
             dictionary.Add("EndTime", this.dateTimePickerEnd.Text);
             dictionary.Add("CommSpec", this.checkBoxCommSpec.Checked);
             dictionary.Add("Trans", this.checkBoxTrans.Checked);
             dictionary.Add("Vech", this.checkBoxVech.Checked);
             BaseDAOFactory.GetBaseDAOSQLite().updateSQL("aisino.Fwkp.Wbjk.XSDJClearByDate", dictionary);
             MessageManager.ShowMsgBox("单据清理成功!", "提示");
         }
         base.Close();
     }
     catch (Exception exception)
     {
         MessageManager.ShowMsgBox(exception.Message);
     }
 }
Example #18
0
        public bool Login(bool bool_1, string string_2)
        {
            //逻辑修改:无Key调试时需要把TaxCard登录校验屏蔽掉
            if (InternetWare.Config.Constants.IsTest)
            {
                string_2 = "管理员";
                this.method_1(string_2);
            }
            else
            {
                #region
                bool      flag = false;
                LoginForm form = new LoginForm();
                if (bool_1)
                {
                    flag = false;
                    return(true);
                }
                if (form.ShowDialog() == DialogResult.OK)
                {
                    flag     = true;
                    string_2 = form.method_1();
                }
                if (!bool_1 && !flag)
                {
                    return(false);
                }
                TaxCardFactory.CardType = CTaxCardType.const_7;
                TaxCard card = TaxCardFactory.CreateTaxCard();
                card.CustomMessageBox += new TaxCard.CustomMsgBox(this.method_0);
Label_010F:
                if (!card.TaxCardOpen(form.method_4()) && (card.RetCode != 0))
                {
                    if (card.RetCode == -1111)
                    {
                        ChangeCertPass pass = new ChangeCertPass();
                        pass.method_2(form.method_4());
                        pass.method_3().Enabled = false;
                        pass.method_4(form.method_1());
                        if (pass.ShowDialog() != DialogResult.OK)
                        {
                            MessageBoxHelper.Show("取消证书默认口令修改,退出系统!", "系统登录", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                            return(false);
                        }
                        if (form.method_3())
                        {
                            PropertyUtil.SetValue("Login_" + BitConverter.ToString(ToolUtil.GetBytes(form.method_1())).Replace("-", ""), form.method_2() + "-" + pass.method_5());
                        }
                        else
                        {
                            PropertyUtil.SetValue("Login_" + BitConverter.ToString(ToolUtil.GetBytes(form.method_1())).Replace("-", ""), string.Empty);
                        }
                        MessageBoxHelper.Show("证书口令修改成功,请重新登录系统!", "系统登录", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                        card.CloseDevice();
                        Process.Start(Assembly.GetExecutingAssembly().Location);
                        return(false);
                    }
                    if (!card.ErrCode.StartsWith("CA_"))
                    {
                        MessageManager.ShowMsgBox(card.ErrCode);
                        return(false);
                    }
                    int num4 = Convert.ToInt32(card.ErrCode.Split(new char[] { '_' })[1]);
                    switch (num4)
                    {
                    case 0x3810002a:
                        MessageBoxHelper.Show("证书口令长度不足8个字符", "证书登录错误", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                        return(false);

                    case 0x381063c0:
                        MessageBoxHelper.Show("证书密码被锁死,请解锁后重新登录", "证书登录错误", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                        return(false);

                    default:
                    {
                        if ((num4 >= 0x381063cf) || (num4 <= 0x381063c0))
                        {
                            MessageManager.ShowMsgBox(card.ErrCode);
                            return(false);
                        }
                        int       num5  = num4 - 0x381063c0;
                        CertLogin login = new CertLogin(num5);
                        if (login.ShowDialog() != DialogResult.OK)
                        {
                            MessageBoxHelper.Show("取消证书登录,退出系统!", "系统登录", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                            return(false);
                        }
                        card.CloseDevice();
                        form.method_5(login.method_1());
                        goto Label_010F;
                    }
                    }
                }
                MessageHelper.MsgWait("正在更新发票上传标志,不要插拔金税盘或关闭电源,请耐心等待...");
                ilog_0.Error("开始更新上传标志##########...");
                List <ClearCardInfo> list = card.UpdateUpLoadFlag();
                if (list != null)
                {
                    ilog_0.Error("UpdateUpLoadFlag返回结果个数#############:" + list.Count);
                }
                if ((list != null) && (list.Count > 0))
                {
                    foreach (ClearCardInfo info in list)
                    {
                        try
                        {
                            ilog_0.Error("金税盘RetCode##########:" + info.CSTime.ToString());
                            if (info.CSTime != "")
                            {
                                string str2 = string.Format("【{0}】 抄报清卡", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                                string str  = "update XXFP set BSZT = 1, BSBZ = 1, BSRZ = '" + str2 + "' where BSQ = " + info.InvPeriod.ToString() + " and SSYF = " + info.CSTime.ToString();
                                if (card.SubSoftVersion == "Linux")
                                {
                                    str = "update XXFP set BSBZ = 1, BSRZ = '" + str2 + "' where BSQ = " + info.InvPeriod.ToString() + " and SSYF = " + info.CSTime.ToString();
                                }
                                switch (info.InvKind)
                                {
                                case 0x29:
                                case 0x33:
                                case 12:
                                    str = str + " and (FPZL = 'j' or FPZL = 'p' or FPZL = 'q')";
                                    if (card.QYLX.ISJDC || card.QYLX.ISPTFPDZ)
                                    {
                                        PropertyUtil.SetValue(AttributeName.JDCQKDateName, this.method_2(12, info.CSTime));
                                    }
                                    if (card.QYLX.ISPTFPJSP)
                                    {
                                        PropertyUtil.SetValue(AttributeName.JSPQKDateName, this.method_2(0x29, info.CSTime));
                                    }
                                    break;

                                case 0:
                                case 2:
                                    str = str + " and (FPZL = 's' or FPZL = 'c')";
                                    if (card.QYLX.ISPTFP || card.QYLX.ISZYFP)
                                    {
                                        PropertyUtil.SetValue(AttributeName.ZPQKDateName, this.method_2(0, info.CSTime));
                                    }
                                    break;

                                case 11:
                                    str = str + " and FPZL = 'f'";
                                    if (card.QYLX.ISHY)
                                    {
                                        PropertyUtil.SetValue(AttributeName.HYQKDateName, this.method_2(11, info.CSTime));
                                    }
                                    break;
                                }
                                BaseDAOSQLite baseDAOSQLite = BaseDAOFactory.GetBaseDAOSQLite() as BaseDAOSQLite;
                                if (baseDAOSQLite != null)
                                {
                                    baseDAOSQLite.method_1(str);
                                }
                                else
                                {
                                    MessageBoxHelper.Show("获取数据库实例失败。");
                                }
                                continue;
                            }
                            ilog_0.Error("更新发票上传标志接口返回时间错误:" + info.CSTime);
                        }
                        catch (Exception exception)
                        {
                            MessageBoxHelper.Show(exception.Message);
                            ilog_0.Error(exception.ToString());
                        }
                    }
                }
                ilog_0.Error("结束更新上传标志##########...");
                MessageHelper.MsgWait();
                string regionCode = card.RegionCode;
                if (string.Equals(card.SoftVersion, "FWKP_V2.0_Svr_Client"))
                {
                    PropertyUtil.SetValue("MAIN_CODE", card.TaxCode);
                    PropertyUtil.SetValue("MAIN_MACHINE", card.Machine.ToString());
                    PropertyUtil.SetValue("MAIN_ORGCODE", card.CorpCode.Substring(0, 6));
                }
                if (!string.Equals(card.SoftVersion, "FWKP_V2.0_Svr_Client"))
                {
                    if ((regionCode != null) && (regionCode.Length > 2))
                    {
                        string str4 = regionCode.Substring(0, 2);
                        if (str4 == "91")
                        {
                            str4 = "50";
                        }
                        regionCode = str4 + regionCode.Substring(2);
                    }
                    if (((card.TaxMode == CTaxCardMode.tcmHave) && (card.TaxCode.Length > 15)) && (RegisterManager.SetupOrgCode != regionCode))
                    {
                        ilog_0.Info("注册表中地区编号:" + RegisterManager.SetupOrgCode);
                        ilog_0.Info("金税设备中地区编号:" + regionCode);
                        MessageBoxHelper.Show("安装时输入的地区编号和金税设备中不一致,请重新安装!");
                        return(false);
                    }
                    if (RegisterManager.SetupTaxCode != card.TaxCode)
                    {
                        MessageBoxHelper.Show("安装时输入的税号和金税设备中不一致,请重新安装!");
                        return(false);
                    }
                    if (RegisterManager.SetupMachine != card.Machine)
                    {
                        MessageBoxHelper.Show("安装时输入的开票机号和金税设备中不一致,请重新安装!");
                        return(false);
                    }
                    if (!RegisterManager.PreMakeInvoice())
                    {
                        MessageBoxHelper.Show("开票注册文件验证失败!");
                    }
                }
                #endregion
            }
            return(true);
        }
Example #19
0
        public bool Login(string string_2, string string_3)
        {
            try
            {
                new LoginForm();
                TaxCardFactory.CardType = CTaxCardType.const_7;
                TaxCard card = TaxCardFactory.CreateTaxCard();
                card.CustomMessageBox += new TaxCard.CustomMsgBox(this.method_0);
                if (!card.TaxCardOpen(string_3))
                {
                    return(false);
                }
                MessageHelper.MsgWait("正在更新发票上传标志,不要插拔金税盘或关闭电源,请耐心等待...");
                ilog_0.Error("开始更新上传标志=========...");
                List <ClearCardInfo> list = card.UpdateUpLoadFlag();
                if (list != null)
                {
                    ilog_0.Error("UpdateUpLoadFlag返回结果个数=========:" + list.Count);
                }
                if ((list != null) && (list.Count > 0))
                {
                    foreach (ClearCardInfo info in list)
                    {
                        ilog_0.Error("taxCard.RetCode=========" + card.RetCode);
                        try
                        {
                            ilog_0.Error("taxCard.RetCode=========" + info.CSTime.ToString());
                            if (info.CSTime != "")
                            {
                                string str2    = string.Format("【{0}】 抄报清卡", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                                string message = "update XXFP set BSZT = 1, BSBZ = 1, BSRZ = '" + str2 + "' where BSQ = " + info.InvPeriod.ToString() + " and SSYF = " + info.CSTime.ToString();
                                if (card.SubSoftVersion == "Linux")
                                {
                                    message = "update XXFP set BSBZ = 1, BSRZ = '" + str2 + "' where BSQ = " + info.InvPeriod.ToString() + " and SSYF = " + info.CSTime.ToString();
                                }
                                switch (info.InvKind)
                                {
                                case 0x29:
                                case 0x33:
                                case 12:
                                    message = message + " and (FPZL = 'j' or FPZL = 'p' or FPZL = 'q')";
                                    if (card.QYLX.ISJDC || card.QYLX.ISPTFPDZ)
                                    {
                                        PropertyUtil.SetValue(AttributeName.JDCQKDateName, this.method_2(12, info.CSTime));
                                    }
                                    if (card.QYLX.ISPTFPJSP)
                                    {
                                        PropertyUtil.SetValue(AttributeName.JSPQKDateName, this.method_2(0x29, info.CSTime));
                                    }
                                    break;

                                case 0:
                                case 2:
                                    message = message + " and (FPZL = 's' or FPZL = 'c')";
                                    if (card.QYLX.ISPTFP || card.QYLX.ISZYFP)
                                    {
                                        PropertyUtil.SetValue(AttributeName.ZPQKDateName, this.method_2(0, info.CSTime));
                                    }
                                    break;

                                case 11:
                                    message = message + " and FPZL = 'f'";
                                    if (card.QYLX.ISHY)
                                    {
                                        PropertyUtil.SetValue(AttributeName.HYQKDateName, this.method_2(11, info.CSTime));
                                    }
                                    break;
                                }
                                BaseDAOSQLite baseDAOSQLite = BaseDAOFactory.GetBaseDAOSQLite() as BaseDAOSQLite;
                                ilog_0.Error(message);
                                if (baseDAOSQLite != null)
                                {
                                    baseDAOSQLite.method_1(message);
                                }
                                else
                                {
                                    MessageBoxHelper.Show("获取数据库实例失败。");
                                }
                                continue;
                            }
                            ilog_0.Error("更新发票上传标志接口返回时间错误:" + info.CSTime);
                        }
                        catch (Exception exception)
                        {
                            MessageBoxHelper.Show(exception.Message);
                        }
                    }
                }
                ilog_0.Error("结束更新上传标志=========...");
                MessageHelper.MsgWait();
                string regionCode = card.RegionCode;
                if ((regionCode != null) && (regionCode.Length > 2))
                {
                    string str4 = regionCode.Substring(0, 2);
                    if (str4 == "91")
                    {
                        str4 = "50";
                    }
                    regionCode = str4 + regionCode.Substring(2);
                }
                if (((card.TaxMode == CTaxCardMode.tcmHave) && (card.TaxCode.Length > 15)) && (RegisterManager.SetupOrgCode != regionCode))
                {
                    ilog_0.Info("注册表中地区编号:" + RegisterManager.SetupOrgCode);
                    ilog_0.Info("金税设备中地区编号:" + regionCode);
                    MessageBoxHelper.Show("安装时输入的地区编号和金税设备中不一致,请重新安装!");
                    return(false);
                }
                if (RegisterManager.SetupTaxCode != card.TaxCode)
                {
                    MessageBoxHelper.Show("安装时输入的税号和金税设备中不一致,请重新安装!");
                    return(false);
                }
                if (RegisterManager.SetupMachine != card.Machine)
                {
                    MessageBoxHelper.Show("安装时输入的开票机号和金税设备中不一致,请重新安装!");
                    return(false);
                }
                if (!RegisterManager.PreMakeInvoice())
                {
                    MessageBoxHelper.Show("开票注册文件验证失败!");
                }
                this.method_1(string_2);
                return(true);
            }
            catch (Exception exception2)
            {
                MessageBoxHelper.Show("单点登录失败失败!" + exception2.Message);
            }
            return(false);
        }
Example #20
0
 private SQLiteConnection method_0()
 {
     return(new SQLiteConnection {
         ConnectionString = BaseDAOFactory.GetConnString(1)
     });
 }
Example #21
0
 public Class81()
 {
     this.ibaseDAO_0 = BaseDAOFactory.GetBaseDAOSQLite();
 }
Example #22
0
 public static void smethod_1()
 {
     try
     {
         lock (Class97.dataTable_0)
         {
             List <string> list = new List <string>();
             List <Dictionary <string, object> > parameter = new List <Dictionary <string, object> >();
             List <Dictionary <string, object> > list3     = new List <Dictionary <string, object> >();
             Class89  class2        = new Class89();
             IBaseDAO baseDAOSQLite = BaseDAOFactory.GetBaseDAOSQLite();
             List <Dictionary <string, string> > list4 = new List <Dictionary <string, string> >();
             TaxCard   card     = TaxCard.CreateInstance(CTaxCardType.const_7);
             DataRow[] rowArray = Class97.dataTable_0.Select("(FPStatus = '0' OR FPStatus = '2' OR FPStatus = '4') AND isDBUpdated=false");
             if ((rowArray != null) && (rowArray.Length >= 1))
             {
                 Class81 class3 = new Class81();
                 foreach (DataRow row in rowArray)
                 {
                     if (row["FPStatus"].ToString() == "0")
                     {
                         list.Add("Aisino.Framework.MainForm.UpDown.UpdateFpStatus");
                         parameter.Add(class2.method_0(row));
                         list.Add("Aisino.Framework.MainForm.UpDown.replaceFPSLH");
                         parameter.Add(class2.method_1(row));
                     }
                     else
                     {
                         if (!row["Fplx"].ToString().Equals("DZFP"))
                         {
                             class3.method_6(row["FPNO"].ToString(), row["FPDM"].ToString(), row["Fplx"].ToString(), row["FPStatus"].ToString());
                         }
                         list.Add("Aisino.Framework.MainForm.UpDown.DeleteFPSLH");
                         parameter.Add(class2.method_1(row));
                     }
                     list3.Add(class2.method_2(row));
                     if (card.SubSoftVersion == "Linux")
                     {
                         list4.Add(class2.method_4(row, "down"));
                     }
                 }
                 if (card.SubSoftVersion == "Linux")
                 {
                     string str = new Class84().method_30(list4);
                     Class101.smethod_0("发送给Linux服务器端数据:" + str);
                     Class101.smethod_0("GeneralCmdHandle返回:" + card.GeneralCmdHandle("C028", str));
                     string errCode = card.ErrCode;
                     Class101.smethod_0(string.Concat(new object[] { "ErrorCode:", errCode, "   retCode:", card.RetCode }));
                     string messageInfo = MessageManager.GetMessageInfo(errCode);
                     Class101.smethod_0("RetCode:" + card.RetCode);
                     Class101.smethod_0("底层返回信息:ErrCode:" + errCode + "  描述信息:" + messageInfo);
                     if (((card.RetCode == 0) && (baseDAOSQLite.未确认DAO方法1(list.ToArray(), parameter) > 0)) && (list3.Count >= 1))
                     {
                         for (int i = 0; i < list3.Count; i++)
                         {
                             class2.method_3(list3[i]);
                             Class101.smethod_0("(下载线程)更新数据库:发票代码:" + list3[i]["FPDM"].ToString() + "   发票号码:" + list3[i]["FPHM"].ToString() + "   报送状态:" + list3[i]["BSZT"].ToString());
                         }
                     }
                 }
                 else if ((baseDAOSQLite.未确认DAO方法1(list.ToArray(), parameter) > 0) && (list3.Count >= 1))
                 {
                     for (int j = 0; j < list3.Count; j++)
                     {
                         class2.method_3(list3[j]);
                         Class101.smethod_0("(下载线程)更新数据库:发票代码:" + list3[j]["FPDM"].ToString() + "   发票号码:" + list3[j]["FPHM"].ToString() + "   报送状态:" + list3[j]["BSZT"].ToString());
                     }
                 }
             }
         }
     }
     catch (Exception exception)
     {
         Class101.smethod_1("(下载线程)批量更新数据库(0-2)失败!" + exception.ToString());
     }
 }
Example #23
0
 public FPDetailDAL()
 {
     this.ibaseDAO_0 = BaseDAOFactory.GetBaseDAOSQLite();
     this.ilog_0     = LogUtil.GetLogger <BSDataOutput>();
     this.string_0   = "";
 }
Example #24
0
        public void Update_SP()
        {
            List <string> sqlID = new List <string>();
            List <Dictionary <string, object> > param = new List <Dictionary <string, object> >();
            DataTable table = this.QuerySPNotYHZCMC();

            if (table != null)
            {
                BMSPFLManager manager = new BMSPFLManager();
                for (int i = 0; i < table.Rows.Count; i++)
                {
                    string str        = table.Rows[i]["BM"].ToString();
                    string str2       = table.Rows[i]["MC"].ToString();
                    string slv        = table.Rows[i]["SLV"].ToString();
                    bool   flag       = bool.Parse(table.Rows[i]["HYSY"].ToString());
                    string bm         = table.Rows[i]["SPFL"].ToString();
                    string str5       = table.Rows[i]["YHZC"].ToString();
                    string str6       = table.Rows[i]["YHZCMC"].ToString();
                    string str7       = table.Rows[i]["LSLVBS"].ToString();
                    string sPFLMCBYBM = manager.GetSPFLMCBYBM(bm);
                    Dictionary <string, object> item = new Dictionary <string, object>();
                    IBaseDAO baseDAOSQLite           = BaseDAOFactory.GetBaseDAOSQLite();
                    item.Add("BM", bm);
                    ArrayList list3 = baseDAOSQLite.querySQL("aisino.Fwkp.Bmgl.BMSPFL.SelectYHZCS", item);
                    str5 = "否";
                    bool ishysy = flag;
                    foreach (Dictionary <string, object> dictionary2 in list3)
                    {
                        string[] strArray = dictionary2["ZZSTSGL"].ToString().Split(new string[] { "、", ",", "," }, StringSplitOptions.RemoveEmptyEntries);
                        for (int j = 0; j < strArray.Length; j++)
                        {
                            if (this.yhzc_contain_slv(strArray[j], slv, ishysy))
                            {
                                str5 = "是";
                                str6 = strArray[j];
                                if ((str6 == "出口零税") && (slv == "0"))
                                {
                                    str7 = "0";
                                }
                                else if ((str6 == "免税") && (slv == "0"))
                                {
                                    str7 = "1";
                                }
                                else if ((str6 == "不征税") && (slv == "0"))
                                {
                                    str7 = "2";
                                }
                                break;
                            }
                        }
                    }
                    item.Clear();
                    item.Add("SPFLMC", sPFLMCBYBM);
                    item.Add("YHZC", str5);
                    item.Add("YHZCMC", str6);
                    item.Add("BM", str);
                    item.Add("MC", str2);
                    item.Add("LSLVBS", str7);
                    sqlID.Add("aisino.Fwkp.Bmgl.BMSP.UpdataBM_SP");
                    param.Add(item);
                }
                new BMSPFLManager().UpdateSPFLTable(sqlID, param, false);
            }
        }