Beispiel #1
0
 public bool setValue(Dictionary <string, object> dict)
 {
     try
     {
         this.lab_Fpzl.Text = "发票种类:";
         this.lab_Fpdm.Text = "开票代码:";
         this.lab_Fphm.Text = "发票号码:";
         if (dict.Count <= 0)
         {
             base.Close();
             this.loger.Error("发票种类、发票代码、发票号码传入失败。");
             MessageManager.ShowMsgBox("FPCX-000022");
             return(false);
         }
         if ((!dict.ContainsKey("lbl_Fpzl") || !dict.ContainsKey("lbl_Fpdm")) || !dict.ContainsKey("lbl_Fphm"))
         {
             base.Close();
             this.loger.Error("发票种类、发票代码、发票号码传入失败。");
             MessageManager.ShowMsgBox("FPCX-000022");
             return(false);
         }
         this.lab_Fpzl.Text = (string)dict["lbl_Fpzl"];
         this.lab_Fpdm.Text = (string)dict["lbl_Fpdm"];
         this.lab_Fphm.Text = ShareMethods.FPHMTo8Wei(dict["lbl_Fphm"].ToString());
     }
     catch (Exception exception)
     {
         this.loger.Error(exception.Message);
     }
     return(true);
 }
Beispiel #2
0
 public void InsertData(List <NoReadInvStock> allRepeats)
 {
     try
     {
         if (this.csdgList.DataSource != null)
         {
             ((DataTable)this.csdgList.DataSource).Clear();
         }
         DataTable table = new DataTable();
         table.Columns.Add("CWH", typeof(string));
         table.Columns.Add("FPDM", typeof(string));
         table.Columns.Add("QSHM", typeof(string));
         table.Columns.Add("FPZS", typeof(string));
         foreach (NoReadInvStock stock in allRepeats)
         {
             DataRow row = table.NewRow();
             row["CWH"]  = stock.ErrNo.ToString();
             row["FPDM"] = stock.InvCode;
             row["QSHM"] = ShareMethods.FPHMTo8Wei(stock.InvNo);
             row["FPZS"] = stock.Count.ToString();
             table.Rows.Add(row);
         }
         this.csdgList.DataSource = table;
     }
     catch (BaseException exception)
     {
         ExceptionHandler.HandleError(exception);
     }
     catch (Exception exception2)
     {
         ExceptionHandler.HandleError(exception2);
     }
 }
 protected override void InsertData(List <InvVolumeApp> ListModel)
 {
     try
     {
         if (base.customStyleDataGrid1.DataSource != null)
         {
             ((DataTable)base.customStyleDataGrid1.DataSource).Clear();
         }
         if (this.CheckEmpty(ListModel))
         {
             DataTable table     = this.CreateTableHeader();
             int       num       = 0;
             int       yearExist = 0x7fffffff;
             foreach (InvVolumeApp app in ListModel)
             {
                 if (((11 != app.InvType) && (0x33 != app.InvType)) && (0x29 != app.InvType))
                 {
                     int number = app.Number;
                     if (('0' != app.Status) && (number > 0))
                     {
                         DataRow row     = table.NewRow();
                         string  invType = ShareMethods.GetInvType(app.InvType);
                         row["FPZL"] = invType;
                         row["KPXE"] = this.GetInvUpLimit(invType);
                         row["JH"]   = Convert.ToString(num++);
                         row["LBDM"] = app.TypeCode;
                         row["MC"]   = ShareMethods.GetFPLBMC(app, base._dictFPLBBM);
                         row["QSHM"] = ShareMethods.FPHMTo8Wei(app.HeadCode);
                         row["SYZS"] = Convert.ToString(number);
                         uint num4 = (app.HeadCode + app.Number) - 1;
                         row["JZZH"] = num4.ToString().PadLeft(8, '0');
                         row["LGRQ"] = app.BuyDate.ToString("yyyy-MM-dd");
                         row["LGZS"] = app.BuyNumber.ToString();
                         if (app.BuyDate.Year < yearExist)
                         {
                             yearExist = app.BuyDate.Year;
                         }
                         table.Rows.Add(row);
                     }
                 }
             }
             base.customStyleDataGrid1.DataSource = table;
             this.InitializeQueryComponents(yearExist);
         }
     }
     catch (BaseException exception)
     {
         base._bError = true;
         this.loger.Error(exception.Message);
         ExceptionHandler.HandleError(exception);
     }
     catch (Exception exception2)
     {
         base._bError = true;
         this.loger.Error(exception2.Message);
         ExceptionHandler.HandleError(exception2);
     }
 }
Beispiel #4
0
 private void InsertData(List <InvVolumeApp> ListModel)
 {
     try
     {
         if (this.csdgList.DataSource != null)
         {
             ((DataTable)this.csdgList.DataSource).Clear();
         }
         if ((ListModel == null) || (ListModel.Count <= 0))
         {
             MessageManager.ShowMsgBox("INP-441242");
         }
         else
         {
             DataTable table = new DataTable();
             table.Columns.Add("xz", typeof(bool));
             table.Columns.Add("fpzl", typeof(string));
             table.Columns.Add("fpdm", typeof(string));
             table.Columns.Add("qshm", typeof(string));
             table.Columns.Add("fpzs", typeof(string));
             foreach (InvVolumeApp app in ListModel)
             {
                 DataRow row = table.NewRow();
                 row["xz"]   = true;
                 row["fpzl"] = ShareMethods.GetInvType(app.InvType);
                 row["fpdm"] = app.TypeCode;
                 row["qshm"] = ShareMethods.FPHMTo8Wei(app.HeadCode);
                 row["fpzs"] = Convert.ToString(app.Number);
                 table.Rows.Add(row);
             }
             this.csdgList.DataSource = table;
             this.btnFpxz.Enabled     = true;
         }
     }
     catch (BaseException exception)
     {
         this.loger.Error(exception.Message);
         ExceptionHandler.HandleError(exception);
     }
     catch (Exception exception2)
     {
         this.loger.Error(exception2.Message);
         ExceptionHandler.HandleError(exception2);
     }
 }
Beispiel #5
0
        /// <summary>
        /// 对应 FaPiaoZuoFei_WeiKai 的 ZuoFeiMainFunction 方法
        /// </summary>
        private BaseResult DoWeiKaiZuoFei(WeiKaiChaXunResult fpInfo)
        {
            int zuoFeiNum = _args.Count;

            try
            {
                int                 num    = 0;
                int                 num2   = 0;
                int                 num3   = 0x1770;
                List <Fpxx>         FpList = new List <Fpxx>();
                FaPiaoZuoFei_WeiKai form   = new FaPiaoZuoFei_WeiKai();
                for (int i = 0; i < zuoFeiNum; i++)
                {
                    string   dbfpzl = form.GetInvoiceType(CommonMethods.ParseFplx(_args.FpType)).dbfpzl;
                    string   str3   = fpInfo.Fpdm;
                    string   str4   = ShareMethods.FPHMTo8Wei(fpInfo.InvNum);
                    string   str5   = form.IsEmpty_DengYu(form.TaxCardInstance.Address) + " " + form.TaxCardInstance.Telephone;
                    string   str6   = form.IsEmpty_DengYu(form.TaxCardInstance.BankAccount);
                    string   title  = "正在作废发票代码:" + str3 + "发票号码:" + str4;
                    object[] param  = new object[] { dbfpzl, str3, str4, DingYiZhiFuChuan1._UserMsg.MC, str5, str6 };
                    Fpxx     item   = form.BlankWasteTaxCardZuoFei(param);
                    if ((item == null) || !(item.retCode == "0000"))
                    {
                        break;
                    }
                    FpList.Add(item);
                    num++;
                }
                form.xxfpChaXunBll.SaveXxfp(FpList);
                num2 = zuoFeiNum - num;
                return(new CountableResult(_args, zuoFeiNum, num, num2));
                //MessageManager.ShowMsgBox("FPZF-000010", new string[] { ZuoFeiNum.ToString(), num.ToString(), num2.ToString() });
            }
            catch (Exception exception)
            {
                //this.loger.Error("[ZuoFeiMainFunction函数异常]" + exception.ToString());
                return(new BaseResult(_args, new ErrorBase($"错误类型:{exception.GetType()} || 错误信息:{exception.Message}")));
            }
        }
Beispiel #6
0
        public void InsertInvVolume(List <InvVolumeApp> invList)
        {
            InvSQInfo invUpLimit = base.TaxCardInstance.get_SQInfo();
            int       num        = 0;
            DataTable table      = this.CreateTableHeader();

            foreach (InvVolumeApp app in invList)
            {
                num = 0;
                DataRow row     = table.NewRow();
                string  invType = ShareMethods.GetInvType(app.InvType);
                row[this.strHead[num++]] = invType;
                double upLimit = ShareMethods.GetUpLimit(invUpLimit, invType);
                row[this.strHead[num++]] = Convert.ToString(upLimit);
                row[this.strHead[num++]] = app.TypeCode;
                row[this.strHead[num++]] = ShareMethods.GetFPLBMC(app, this._dictFPLBBM);
                row[this.strHead[num++]] = ShareMethods.FPHMTo8Wei(app.HeadCode);
                int number = app.Number;
                row[this.strHead[num++]] = Convert.ToString(number);
                row[this.strHead[num++]] = app.BuyDate.ToString("yyyy-MM-dd");
                table.Rows.Add(row);
            }
            this.dgInvInfo.DataSource = table;
        }
        private string GenDownloadXML()
        {
            XmlDocument document = new XmlDocument();

            document.CreateXmlDeclaration("1.0", "GBK", "yes");
            XmlDeclaration newChild = document.CreateXmlDeclaration("1.0", "GBK", null);

            document.AppendChild(newChild);
            System.Xml.XmlNode node  = document.CreateElement("FPXT");
            System.Xml.XmlNode node2 = document.CreateElement("INPUT");
            System.Xml.XmlNode node3 = document.CreateElement("NSRSBH");
            node3.InnerText = base.TaxCardInstance.TaxCode;
            System.Xml.XmlNode node4 = document.CreateElement("JSPH");
            node4.InnerText = base.TaxCardInstance.GetInvControlNum();
            System.Xml.XmlNode node5 = document.CreateElement("KPJH");
            node5.InnerText = base.TaxCardInstance.Machine.ToString();
            System.Xml.XmlNode node6 = document.CreateElement("FPDM");
            node6.InnerText = this.txt_fpdm.Text.Trim();
            System.Xml.XmlNode node7 = document.CreateElement("FPHM");
            node7.InnerText = ShareMethods.FPHMTo8Wei(this.txt_fphm.Text.Trim());
            System.Xml.XmlNode node8  = document.CreateElement("KPRQ");
            System.Xml.XmlNode node10 = document.CreateElement("FPLX");
            string             str    = "";

            this.cmb_fpzl.DropDownStyle = ComboBoxStyle.DropDownList;
            if (this.cmb_fpzl.SelectedIndex == 0)
            {
                str = "01";
            }
            else if (this.cmb_fpzl.SelectedIndex == 1)
            {
                str = "02";
            }
            else if (this.cmb_fpzl.SelectedIndex == 2)
            {
                str = "03";
            }
            else if (this.cmb_fpzl.SelectedIndex == 3)
            {
                str = "04";
            }
            node10.InnerText = str;
            node8.InnerText  = "";
            if (this.data_kprq.Checked)
            {
                DateTime time1 = this.data_kprq.Value;
                node8.InnerText = this.data_kprq.Value.ToString("yyyyMMdd");
            }
            System.Xml.XmlNode node9 = document.CreateElement("XFSH");
            node9.InnerText = "";
            document.AppendChild(node);
            node.AppendChild(node2);
            node2.AppendChild(node3);
            node2.AppendChild(node4);
            node2.AppendChild(node5);
            node2.AppendChild(node6);
            node2.AppendChild(node7);
            node2.AppendChild(node8);
            node2.AppendChild(node9);
            node2.AppendChild(node10);
            if (((this.txt_fpdm.Text.Length != 0) && (this.txt_fphm.Text.Length != 0)) && ((str.Length != 0) && this.data_kprq.Checked))
            {
                int result = 0;
                if ((this.txt_fphm.Text.Length <= 8) && int.TryParse(this.txt_fphm.Text.ToString(), out result))
                {
                    return(document.InnerXml);
                }
            }
            return(null);
        }
 public void ZuoFeiMainFunction(int ZuoFeiNum)
 {
     try
     {
         UpLoadCheckState.SetFpxfState(true);
         int num  = 0;
         int num2 = 0;
         int num3 = 0x1770;
         this.FpList.Clear();
         InvCodeNum invCodeNum = new InvCodeNum();
         if (this.progressBar == null)
         {
             this.progressBar = new FPProgressBar();
         }
         this.progressBar.SetTip("正在作废未开发票", "请等待任务完成", "未开发票作废过程");
         this.progressBar.Visible = true;
         this.progressBar.Refresh();
         this.progressBar.Show();
         this.progressBar.Refresh();
         this.ProcessStartThread(this.step);
         this.progressBar.Refresh();
         for (int i = 0; i < ZuoFeiNum; i++)
         {
             if (this.GetTaxCardCurrentFpNum(ref invCodeNum) != "0000")
             {
                 MessageManager.ShowMsgBox("FPZF-000012");
                 this.progressBar.Visible = false;
                 this.progressBar.Refresh();
                 return;
             }
             string dbfpzl = this.GetInvoiceType(this.FaPiaoType).dbfpzl;
             string str3   = this.lab_fpdm.Text.Trim();
             string str4   = ShareMethods.FPHMTo8Wei(invCodeNum.InvNum);
             string str5   = this.IsEmpty_DengYu(base.TaxCardInstance.Address) + " " + base.TaxCardInstance.Telephone;
             string str6   = this.IsEmpty_DengYu(base.TaxCardInstance.BankAccount);
             string title  = "正在作废发票代码:" + str3 + "发票号码:" + str4;
             this.progressBar.SetTip(title, "请等待任务完成", "未开发票作废过程");
             this.ProcessStartThread(num3 / ZuoFeiNum);
             this.progressBar.Refresh();
             object[] param = new object[] { dbfpzl, str3, str4, DingYiZhiFuChuan1._UserMsg.MC, str5, str6 };
             Fpxx     item  = this.BlankWasteTaxCardZuoFei(param);
             if ((item == null) || !(item.retCode == "0000"))
             {
                 break;
             }
             this.FpList.Add(item);
             num++;
         }
         this.xxfpChaXunBll.SaveXxfp(this.FpList);
         this.progressBar.SetTip("正在将作废发票写入数据库", "请等待任务完成", "未开发票作废过程");
         this.ProcessStartThread(this.step);
         this.progressBar.Refresh();
         this.progressBar.Visible = false;
         num2 = ZuoFeiNum - num;
         MessageManager.ShowMsgBox("FPZF-000010", new string[] { ZuoFeiNum.ToString(), num.ToString(), num2.ToString() });
     }
     catch (Exception exception)
     {
         this.loger.Error("[ZuoFeiMainFunction函数异常]" + exception.ToString());
     }
     finally
     {
         if (this.progressBar != null)
         {
             this.progressBar.Visible = false;
             this.progressBar.Close();
             this.progressBar.Dispose();
             this.progressBar = null;
             GC.Collect();
         }
         UpLoadCheckState.SetFpxfState(false);
     }
 }
Beispiel #9
0
        public bool setValue(Dictionary <string, object> dict)
        {
            try
            {
                this.lbl_FpDm.Text = "发票代码:";
                this.lbl_FpHm.Text = "发票号码:";
                this.lbl_KpRq.Text = "开票日期:";
                this.lbl_GfSh.Text = "购方税号:";
                this.lbl_XfSh.Text = "销方税号:";
                this.lbl_JE.Text   = "金    额:";
                this.lbl_SE.Text   = "税    额:";
                this.lbl_ZfBz.Text = "作废标志:";
                this.lbl_BSZT.Text = "报送状态:";
                if (base.TaxCardInstance.QYLX.ISTDQY)
                {
                    this.lbl_BSZT.Visible = false;
                }
                if (dict.Count <= 0)
                {
                    base.Close();
                    this.loger.Error("发票种类、发票代码、发票号码传入失败。");
                    MessageManager.ShowMsgBox("FPCX-000022");
                    return(false);
                }
                if ((!dict.ContainsKey("lbl_FpHm") || !dict.ContainsKey("lbl_FpDm")) || ((!dict.ContainsKey("lbl_DZSYH") || !dict.ContainsKey("lbl_KPSXH")) || !dict.ContainsKey("lbl_KpRq")))
                {
                    base.Close();
                    this.loger.Error("发票种类、发票代码、发票号码传入失败。");
                    MessageManager.ShowMsgBox("FPCX-000022");
                    return(false);
                }
                InvDetail detail = base.TaxCardInstance.QueryInvInfo(dict["lbl_FpDm"].ToString(), Aisino.Fwkp.Fpkj.Common.Tool.ObjectToInt(dict["lbl_FpHm"]), dict["lbl_DZSYH"].ToString(), dict["lbl_KPSXH"].ToString(), Aisino.Fwkp.Fpkj.Common.Tool.ObjectToDateTime(dict["lbl_KpRq"]));
                if (base.TaxCardInstance.RetCode != 0)
                {
                    MessageManager.ShowMsgBox(base.TaxCardInstance.ErrCode);
                    return(false);
                }
                Fpxx fpxx = null;
                if (base.TaxCardInstance.SoftVersion != "FWKP_V2.0_Svr_Client")
                {
                    fpxx = new Fpxx();
                    fpxx.RepairInv(detail, -1);
                }
                else if (base.TaxCardInstance.SubSoftVersion != "Linux")
                {
                    fpxx = (Fpxx)SerializeUtil.Deserialize(ToolUtil.FromBase64String(detail.OldInvNo));
                }
                else
                {
                    fpxx = Fpxx.DeSeriealize_Linux(ToolUtil.FromBase64String(detail.OldInvNo));
                }
                if ((detail.TypeCode == "") && (detail.InvNo == 0))
                {
                    MessageManager.ShowMsgBox("FPCX-000031", new string[] { dict["lbl_FpDm"].ToString(), ShareMethods.FPHMTo8Wei(dict["lbl_FpHm"].ToString()) });
                    return(false);
                }
                if (!string.IsNullOrEmpty(detail.TypeCode))
                {
                    this.lbl_FpDm.Text = this.lbl_FpDm.Text + detail.TypeCode.Trim();
                }
                this.lbl_FpHm.Text = this.lbl_FpHm.Text + ShareMethods.FPHMTo8Wei(detail.InvNo);
                if (((int)fpxx.fplx == 2) && ((int)fpxx.Zyfplx == 9))
                {
                    if (!string.IsNullOrEmpty(detail.SaleTaxCode))
                    {
                        this.lbl_GfSh.Text = this.lbl_GfSh.Text + detail.SaleTaxCode.Trim();
                    }
                    if (!string.IsNullOrEmpty(detail.BuyTaxCode))
                    {
                        this.lbl_XfSh.Text = this.lbl_XfSh.Text + detail.BuyTaxCode.Trim();
                    }
                }
                else
                {
                    if (!string.IsNullOrEmpty(detail.BuyTaxCode))
                    {
                        if ((detail.InvType == 12) && !fpxx.isNewJdcfp)
                        {
                            if (fpxx.sfzhm.Length > 0)
                            {
                                this.lbl_GfSh.Text = "身份证号码/组织机构代码:" + fpxx.sfzhm;
                            }
                            else
                            {
                                this.lbl_GfSh.Text = "身份证号码/组织机构代码:" + new string('0', 15);
                            }
                        }
                        else
                        {
                            this.lbl_GfSh.Text = this.lbl_GfSh.Text + detail.BuyTaxCode.Trim();
                        }
                    }
                    if (!string.IsNullOrEmpty(detail.SaleTaxCode))
                    {
                        this.lbl_XfSh.Text = this.lbl_XfSh.Text + detail.SaleTaxCode.Trim();
                    }
                }
                DateTime date = detail.Date;
                this.lbl_KpRq.Text = this.lbl_KpRq.Text + detail.Date.ToString("yyyy年MM月dd日");
                this.lbl_JE.Text   = this.lbl_JE.Text + Convert.ToString(detail.Amount.ToString("0.00"));
                this.lbl_SE.Text   = this.lbl_SE.Text + Convert.ToString(detail.Tax.ToString("0.00"));
                if (detail.CancelFlag)
                {
                    this.lbl_ZfBz.Text = this.lbl_ZfBz.Text + "是";
                }
                else
                {
                    this.lbl_ZfBz.Text = this.lbl_ZfBz.Text + "否";
                }
                string str = "未报送";
                switch (fpxx.bszt)
                {
                case 0:
                    str = "未报送";
                    break;

                case 1:
                    str = "已报送";
                    break;

                case 2:
                    str = "报送失败";
                    break;

                case 3:
                    str = "报送中";
                    break;

                case 4:
                    str = "验签失败";
                    break;

                default:
                    str = "未报送";
                    break;
                }
                this.lbl_BSZT.Text = this.lbl_BSZT.Text + str;
            }
            catch (Exception exception)
            {
                this.loger.Error(exception.Message);
                MessageManager.ShowMsgBox(exception.Message);
                return(false);
            }
            return(true);
        }
Beispiel #10
0
 protected virtual void QueryIndexChanged(object sender, EventArgs e)
 {
     try
     {
         if (this.queryInitialized)
         {
             this._ListModel = base.TaxCardInstance.GetInvStock();
             if (0 < base.TaxCardInstance.get_RetCode())
             {
                 MessageManager.ShowMsgBox(base.TaxCardInstance.get_ErrCode());
                 this._bError = true;
                 base.Close();
             }
             else
             {
                 if (this.customStyleDataGrid1.DataSource != null)
                 {
                     ((DataTable)this.customStyleDataGrid1.DataSource).Clear();
                 }
                 DataTable table = this.CreateTableHeader();
                 int       num   = 0;
                 int       num2  = 0;
                 while (num2 < this._ListModel.Count)
                 {
                     DataRow row     = table.NewRow();
                     string  invType = ShareMethods.GetInvType(this._ListModel[num2].InvType);
                     if (this.InvTypeMatched(invType))
                     {
                         row["FPZL"] = invType;
                         DateTime buyDate = this._ListModel[num2].BuyDate;
                         if (this.InvYearMatched(buyDate.Year.ToString()) && this.InvMonthMatched(buyDate.Month.ToString()))
                         {
                             row["LGRQ"] = buyDate.ToString("yyyy-MM-dd");
                             row["KPXE"] = this.GetInvUpLimit(invType);
                             row["JH"]   = Convert.ToString(num);
                             row["LBDM"] = this._ListModel[num2].TypeCode;
                             row["MC"]   = ShareMethods.GetFPLBMC(this._ListModel[num2], this._dictFPLBBM);
                             row["QSHM"] = ShareMethods.FPHMTo8Wei(this._ListModel[num2].HeadCode);
                             row["SYZS"] = Convert.ToString(this._ListModel[num2].Number);
                             uint num5 = (this._ListModel[num2].HeadCode + this._ListModel[num2].Number) - 1;
                             row["JZZH"] = num5.ToString().PadLeft(8, '0');
                             row["LGZS"] = this._ListModel[num2].BuyNumber.ToString();
                             table.Rows.Add(row);
                         }
                     }
                     num2++;
                     num++;
                 }
                 this.customStyleDataGrid1.DataSource = table;
             }
         }
     }
     catch (BaseException exception)
     {
         this.loger.Error(exception.Message);
         ExceptionHandler.HandleError(exception);
     }
     catch (Exception exception2)
     {
         this.loger.Error(exception2.Message);
         ExceptionHandler.HandleError(exception2);
     }
 }