Example #1
0
 protected override object[] doService(object[] param)
 {
     object[] objArray = new object[] { 0, "存库失败" };
     try
     {
         if ((param == null) || (param.Length < 2))
         {
             this.loger.Error("单张发票修复发票参数个数不正确,参数个数为:" + param.Length);
             objArray[0] = 0;
             objArray[1] = "单张发票修复发票参数个数不正确,参数个数为:" + param.Length;
             return(objArray);
         }
         int      length = param.Length;
         string   str    = "";
         int      num2   = 0;
         string   str2   = "6666666";
         string   str3   = "6666666";
         DateTime now    = DateTime.Now;
         if (length >= 1)
         {
             str = param[0].ToString();
         }
         if (length >= 2)
         {
             num2 = Tool.ObjectToInt(param[1].ToString());
         }
         if (length >= 3)
         {
             str2 = param[2].ToString();
         }
         if (length >= 4)
         {
             str3 = param[3].ToString();
         }
         if (length >= 5)
         {
             now = Tool.ObjectToDateTime(param[4].ToString());
         }
         this.loger.Debug(string.Concat(new object[] { "发票代码:", str, "发票号码:", num2, "syh:", str2, "sxh:", str3 }));
         InvDetail detail = this.taxCard.QueryInvInfo(str, num2, str2, str3, now);
         if (this.taxCard.RetCode != 0)
         {
             this.loger.Error("单张修复底层读取发票失败,错误号:" + this.taxCard.RetCode);
             this.loger.Debug(string.Concat(new object[] { "发票代码:", str, "发票号码:", num2, "syh:", str2, "sxh:", str3, "开票日期:", now.ToString() }));
             objArray[0] = 0;
             objArray[1] = "单张修复底层读取发票失败,错误号:" + this.taxCard.RetCode;
             return(objArray);
         }
         Fpxx item = null;
         if (this.taxCard.SoftVersion != "FWKP_V2.0_Svr_Client")
         {
             item = new Fpxx();
             item.RepairInv(detail, -1);
         }
         else
         {
             item = Fpxx.DeSeriealize_Linux(ToolUtil.FromBase64String(detail.OldInvNo));
         }
         if (item != null)
         {
             List <Fpxx> fpList = new List <Fpxx>();
             item.dybz = true;
             item.xfbz = true;
             if (item.fplx == (FPLX)0x29)
             {
                 item.gfdzdh = "";
                 item.gfyhzh = "";
                 item.xfdzdh = "";
                 item.xfyhzh = "";
                 item.mw     = "";
                 item.kpr    = "";
                 item.fhr    = "";
             }
             fpList.Add(item);
             this.dal.SaveXxfp(fpList);
             objArray[0] = 1;
             objArray[1] = "";
             this.loger.Error("单张发票修复成功");
             return(objArray);
         }
         objArray[0] = 0;
         objArray[1] = "单张发票修复失败";
         this.loger.Error("单张发票修复失败");
         return(objArray);
     }
     catch (Exception exception)
     {
         objArray[0] = 0;
         objArray[1] = exception.ToString();
         this.loger.Error("[FPXiuFuSingleShareMethods函数异常]" + exception.ToString());
         return(objArray);
     }
 }
Example #2
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);
        }