Пример #1
0
        //报警删除
        protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            string key1 = GridView1.DataKeys[e.RowIndex].Values[0].ToString();
            string key2 = GridView1.DataKeys[e.RowIndex].Values[1].ToString();

            int flag = DataOperate.deleteInvoiceInfo(key1, key2);

            if (flag > 0)
            {
                string invoiceType = this.DropDownList1.SelectedValue.ToString();
                //起始日期
                string startDate = this.startDate.Text;
                //结束日期
                string endDate = this.endDate.Text;
                //string endDate = this.DropDownList_DepotType.SelectedValue;
                //填充数据源
                //GridView1.DataSource = CheckStatBll.getCheckStatByCondition(materialType, depotId, depotType, goodsName);
                string  operatorID = Request.LogonUserIdentity.Name;
                DataSet ds         = DataOperate.exportInvoiceInfo(invoiceType, startDate, endDate, operatorID);
                DataSet ds1        = DataOperate.queryInvoiceInfo(invoiceType, startDate, endDate, operatorID);
                GridView1.DataSource   = ds1.Tables[0];
                GridView1.DataKeyNames = new string[] { "InvoiceCode", "InvoiceNumber" };//主键
                GridView1.DataBind();
                GridView2.DataSource = ds.Tables[1];
                GridView2.DataBind();
                Response.Write("<script language=javascript>alert('删除发票代码:" + key1 + ",号码:" + key2 + "记录成功!');</script>");
            }
            else
            {
                Response.Write("<script language=javascript>alert('删除发票记录失败!');</script>");
            }
        }
Пример #2
0
        protected void search_Click(object sender, EventArgs e)
        {
            //发票类型代码:00所有/01专票/04普票
            string invoiceType = this.DropDownList1.SelectedValue.ToString();
            //起始日期
            string startDate = this.startDate.Text;
            //结束日期
            string endDate    = this.endDate.Text;
            string operatorID = Request.LogonUserIdentity.Name;

            if (invoiceType != "" && startDate != "" && endDate != "" && operatorID != "")
            {
                DataSet ds = DataOperate.queryInvoiceInfo(invoiceType, startDate, endDate, operatorID);
                GridView1.DataSource   = ds.Tables[0];
                GridView1.DataKeyNames = new string[] { "InvoiceCode", "InvoiceNumber" };//主键
                GridView1.DataBind();
                if (!(ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0))
                {
                    Response.Write("<script language=javascript>alert('该时间段内没有该类型发票!');</script>");
                }
            }
            else
            {
                Response.Write("<script language=javascript>alert('请完善查询起止日期!');</script>");
            }
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string operatorID = Request.LogonUserIdentity.Name;

            if (!IsPostBack)
            {
                string result = "";
                try
                {
                    string OperatorID = Request.LogonUserIdentity.Name;
                    if (OperatorID != "")
                    {
                        DataSet ds = DataOperate.JudgeHasAuth(OperatorID);
                        if (ds != null && ds.Tables[0].Rows.Count > 0)
                        {
                            result = "<script language=javascript>alert('授权登录!');</script>";
                        }
                        else
                        {
                            NetLog.WriteTextLog(operatorID, "【登录平台】", "【查无登录权限】");
                            result = "<script language=javascript>alert('查无权限!');window.location='./NoAuth.html';</script>";
                            Response.Write(result);
                            Response.End();
                        }
                    }
                    else
                    {
                        result = "<script language=javascript>alert('登录失效!');window.location='./NoAuth.html';</script>";
                        Response.Write(result);
                        Response.End();
                    }
                }
                catch (Exception ex) {
                    result = "<script language=javascript>alert('" + ex.Message + "');window.location='./NoAuth.html';</script>";
                    Response.Write(result);
                    Response.End();
                }
                Response.Write(result);
            }
        }
Пример #4
0
        protected void positioning_Click(object sender, EventArgs e)
        {
            //业务单号
            string djsys = this.djsys.Text;
            //发票号码
            string invoiceNum = this.invoiceNum.Text;
            string operatorID = Request.LogonUserIdentity.Name;

            if ((djsys != "" || invoiceNum != "") && operatorID != "")
            {
                DataSet ds = DataOperate.positioningInvoiceInfo(djsys, invoiceNum, operatorID);
                GridView1.DataSource   = ds.Tables[0];
                GridView1.DataKeyNames = new string[] { "InvoiceCode", "InvoiceNumber" };//主键
                GridView1.DataBind();
                if (!(ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0))
                {
                    Response.Write("<script language=javascript>alert('数据库查无此记录!');</script>");
                }
            }
            else
            {
                Response.Write("<script language=javascript>alert('请至少输入一个精确查询条件!');</script>");
            }
        }
Пример #5
0
        public void ProcessRequest(HttpContext context)
        {
            string json       = "";
            string operatorID = context.Request.LogonUserIdentity.Name;

            if (context.Request["method"] != null)
            {
                try
                {
                    switch (context.Request.QueryString["method"])
                    {
                    case "checkMethod":
                        InvoiceInfo info = new InvoiceInfo();
                        #region 数据
                        if (context.Request.Form["pData[InvoiceProvince]"] != null)
                        {
                            info.InvoiceProvince = context.Request.Form["pData[InvoiceProvince]"];
                        }
                        if (context.Request.Form["pData[djsys]"] != null)
                        {
                            info.Djsys = context.Request.Form["pData[djsys]"];
                        }
                        if (context.Request.Form["pData[InvoiceType]"] != null)
                        {
                            info.InvoiceType = context.Request.Form["pData[InvoiceType]"];
                        }
                        if (context.Request.Form["pData[InvoiceCode]"] != null)
                        {
                            info.InvoiceCode = context.Request.Form["pData[InvoiceCode]"];
                        }
                        if (context.Request.Form["pData[InvoiceNumber]"] != null)
                        {
                            info.InvoiceNumber = context.Request.Form["pData[InvoiceNumber]"];
                        }
                        if (context.Request.Form["pData[InvoiceDate]"] != null)
                        {
                            info.InvoiceDate = context.Request.Form["pData[InvoiceDate]"];
                        }
                        if (context.Request.Form["pData[CheckCode]"] != null)
                        {
                            info.CheckCode = context.Request.Form["pData[CheckCode]"];
                        }
                        if (context.Request.Form["pData[MachineNumber]"] != null)
                        {
                            info.MachineNumber = context.Request.Form["pData[MachineNumber]"];
                        }
                        if (context.Request.Form["pData[GName]"] != null)
                        {
                            info.GName = context.Request.Form["pData[GName]"];
                        }
                        if (context.Request.Form["pData[GIdentificationCode]"] != null)
                        {
                            info.GIdentificationCode = context.Request.Form["pData[GIdentificationCode]"];
                        }
                        if (context.Request.Form["pData[GAddressPhone]"] != null)
                        {
                            info.GAddressPhone = context.Request.Form["pData[GAddressPhone]"];
                        }
                        if (context.Request.Form["pData[GBankAccount]"] != null)
                        {
                            info.GBankAccount = context.Request.Form["pData[GBankAccount]"];
                        }
                        if (context.Request.Form["pData[PasswordArea]"] != null)
                        {
                            info.PasswordArea = context.Request.Form["pData[PasswordArea]"];
                        }
                        if (context.Request.Form["pData[TotalPriceB]"] != null)
                        {
                            info.TotalPriceB = context.Request.Form["pData[TotalPriceB]"];
                        }
                        if (context.Request.Form["pData[TotalPriceS]"] != null)
                        {
                            info.TotalPriceS = context.Request.Form["pData[TotalPriceS]"];
                        }
                        if (context.Request.Form["pData[XName]"] != null)
                        {
                            info.XName = context.Request.Form["pData[XName]"];
                        }
                        if (context.Request.Form["pData[XIdentificationCode]"] != null)
                        {
                            info.XIdentificationCode = context.Request.Form["pData[XIdentificationCode]"];
                        }
                        if (context.Request.Form["pData[XAddressPhone]"] != null)
                        {
                            info.XAddressPhone = context.Request.Form["pData[XAddressPhone]"];
                        }
                        if (context.Request.Form["pData[XBankAccount]"] != null)
                        {
                            info.XBankAccount = context.Request.Form["pData[XBankAccount]"];
                        }
                        if (context.Request.Form["pData[InspectionTimes]"] != null)
                        {
                            info.InspectionTimes = context.Request.Form["pData[InspectionTimes]"];
                        }
                        if (context.Request.Form["pData[InspectionTime]"] != null)
                        {
                            info.InspectionTime = context.Request.Form["pData[InspectionTime]"];
                        }
                        if (context.Request.Form["pData[Remark]"] != null)
                        {
                            info.Remark = context.Request.Form["pData[Remark]"];
                        }
                        info.OperatorID = context.Request.LogonUserIdentity.Name;
                        #endregion
                        List <InvoiceSubInfo> LsubInfo = new List <InvoiceSubInfo>();
                        if (context.Request.Form["pData[InvoiceSubInfo][0][InvoiceCode]"] != null)
                        {
                            for (int i = 0; i < 100; i++)
                            {
                                InvoiceSubInfo subInfo = new InvoiceSubInfo();
                                #region 子数据
                                if (string.IsNullOrEmpty(context.Request.Form["pData[InvoiceSubInfo][" + i + "][InvoiceCode]"]))
                                {
                                    break;
                                }
                                if (context.Request.Form["pData[InvoiceSubInfo][" + i + "][InvoiceCode]"] != null)
                                {
                                    subInfo.InvoiceCode = context.Request.Form["pData[InvoiceSubInfo][" + i + "][InvoiceCode]"];
                                }
                                if (context.Request.Form["pData[InvoiceSubInfo][" + i + "][InvoiceNumber]"] != null)
                                {
                                    subInfo.InvoiceNumber = context.Request.Form["pData[InvoiceSubInfo][" + i + "][InvoiceNumber]"];
                                }
                                if (context.Request.Form["pData[InvoiceSubInfo][" + i + "][CheckCode]"] != null)
                                {
                                    subInfo.CheckCode = context.Request.Form["pData[InvoiceSubInfo][" + i + "][CheckCode]"];
                                }
                                if (context.Request.Form["pData[InvoiceSubInfo][" + i + "][MachineNumber]"] != null)
                                {
                                    subInfo.MachineNumber = context.Request.Form["pData[InvoiceSubInfo][" + i + "][MachineNumber]"];
                                }
                                if (context.Request.Form["pData[InvoiceSubInfo][" + i + "][NO]"] != null)
                                {
                                    subInfo.NO = i.ToString();
                                }
                                if (context.Request.Form["pData[InvoiceSubInfo][" + i + "][GoodsName]"] != null)
                                {
                                    subInfo.GoodsName = context.Request.Form["pData[InvoiceSubInfo][" + i + "][GoodsName]"];
                                }
                                if (context.Request.Form["pData[InvoiceSubInfo][" + i + "][SpecificationModel]"] != null)
                                {
                                    subInfo.SpecificationModel = context.Request.Form["pData[InvoiceSubInfo][" + i + "][SpecificationModel]"];
                                }
                                if (context.Request.Form["pData[InvoiceSubInfo][" + i + "][Unit]"] != null)
                                {
                                    subInfo.Unit = context.Request.Form["pData[InvoiceSubInfo][" + i + "][Unit]"];
                                }
                                if (context.Request.Form["pData[InvoiceSubInfo][" + i + "][Quantity]"] != null)
                                {
                                    subInfo.Quantity = context.Request.Form["pData[InvoiceSubInfo][" + i + "][Quantity]"];
                                }
                                if (context.Request.Form["pData[InvoiceSubInfo][" + i + "][UnitPrice]"] != null)
                                {
                                    subInfo.UnitPrice = context.Request.Form["pData[InvoiceSubInfo][" + i + "][UnitPrice]"];
                                }
                                if (context.Request.Form["pData[InvoiceSubInfo][" + i + "][Money]"] != null)
                                {
                                    subInfo.Money = context.Request.Form["pData[InvoiceSubInfo][" + i + "][Money]"];
                                }
                                if (context.Request.Form["pData[InvoiceSubInfo][" + i + "][TaxRate]"] != null)
                                {
                                    subInfo.TaxRate = context.Request.Form["pData[InvoiceSubInfo][" + i + "][TaxRate]"];
                                }
                                if (context.Request.Form["pData[InvoiceSubInfo][" + i + "][Tax]"] != null)
                                {
                                    subInfo.Tax = context.Request.Form["pData[InvoiceSubInfo][" + i + "][Tax]"];
                                }
                                if (context.Request.Form["pData[InvoiceSubInfo][" + i + "][Total]"] != null)
                                {
                                    subInfo.Total = context.Request.Form["pData[InvoiceSubInfo][" + i + "][Total]"];
                                }
                                if (context.Request.Form["pData[InvoiceSubInfo][" + i + "][TotalTax]"] != null)
                                {
                                    subInfo.TotalTax = context.Request.Form["pData[InvoiceSubInfo][" + i + "][TotalTax]"];
                                }
                                #endregion
                                LsubInfo.Add(subInfo);
                            }
                            info.SubInfo = LsubInfo;
                        }
                        if (info.InvoiceCode != "")
                        {
                            DataSet ds = DataOperate.JudgeInvoiceInfo(info);
                            if (ds != null && ds.Tables[0].Rows.Count > 0)
                            {
                                json += "{success:'false',inf:'发票重复',plus:'";

                                NetLog.WriteTextLog(operatorID, "【查验发票】", "【发票重复】:" + info.InvoiceNumber);
                                DataView dv = ds.Tables[0].DefaultView;
                                foreach (DataRowView rowview in dv)
                                {
                                    for (int i = 0; i < dv.Table.Columns.Count; i++)
                                    {
                                        json += rowview[i] + ",";
                                    }
                                }
                                json  = json.Remove(json.Length - 1, 1);
                                json += "'}";
                                json  = json.Replace("\\", " ");
                            }
                            else
                            {
                                if (info.InvoiceType == "01")
                                {
                                    DataSet dss = DataOperate.JudgeInvoiceInfoYN(info);
                                    if (dss != null && dss.Tables[0].Rows.Count > 0)
                                    {
                                        int result = DataOperate.InsertInvoiceInfo(info);
                                        if (result > 0)
                                        {
                                            json = "{success:'true',inf:'发票校验成功'}";
                                        }
                                        else
                                        {
                                            json = "{success:'false',inf:'发票数据存储出错'}";
                                        }
                                    }
                                    else
                                    {
                                        json = "{success:'false',inf:'发票名称有误'}";
                                    }
                                }
                                else
                                {
                                    //DataSet dsss = DataOperate.JudgeInvoiceInfoName(info);
                                    //if (dsss != null && dsss.Tables[0].Rows.Count > 0)
                                    //{
                                    int result = DataOperate.InsertInvoiceInfo(info);
                                    if (result > 0)
                                    {
                                        json = "{success:'true',inf:'发票校验成功'}";
                                    }
                                    else
                                    {
                                        json = "{success:'false',inf:'发票数据存储出错'}";
                                    }
                                    //}
                                    //else
                                    //{
                                    //    json = "{success:'false',inf:'发票名称有误'}";
                                    //}
                                }
                            }
                        }

                        break;

                    case "matchMethod":
                        string fpdm        = "";
                        string fphm        = "";
                        string kprq        = "";
                        string operateTime = "";
                        string OperatorID  = context.Request.LogonUserIdentity.Name;
                        if (context.Request.Form["pData[fpdm]"] != null)
                        {
                            fpdm = context.Request.Form["pData[fpdm]"];
                        }
                        if (context.Request.Form["pData[fphm]"] != null)
                        {
                            fphm = context.Request.Form["pData[fphm]"];
                        }
                        if (context.Request.Form["pData[kprq]"] != null)
                        {
                            kprq = context.Request.Form["pData[kprq]"];
                        }
                        if (context.Request.Form["pData[operateTime]"] != null)
                        {
                            operateTime = context.Request.Form["pData[operateTime]"];
                        }

                        if (fpdm != "" && fphm != "" && kprq != "")
                        {
                            DataSet ds = DataOperate.JudgeIsMatch(fpdm, fphm, kprq);
                            if (ds != null && ds.Tables[0].Rows.Count > 0)
                            {
                                json += "{success:'false',inf:'发票重复',plus:'";
                                NetLog.WriteTextLog(operatorID, "【查验发票】", "【发票重复】:" + fphm);

                                DataView dv = ds.Tables[0].DefaultView;
                                foreach (DataRowView rowview in dv)
                                {
                                    for (int i = 0; i < dv.Table.Columns.Count; i++)
                                    {
                                        json += rowview[i] + ",";
                                    }
                                }
                                json  = json.Remove(json.Length - 1, 1);
                                json += "'}";
                                json  = json.Replace("\\", " ");
                            }
                            else
                            {
                                int result = DataOperate.InsertOnlyMatch(fpdm, fphm, kprq, operateTime, OperatorID);
                                if (result > 0)
                                {
                                    json = "{success:'true',inf:'发票保存成功'}";
                                }
                                else
                                {
                                    json = "{success:'false',inf:'发票数据存储出错'}";
                                }
                            }
                        }
                        else
                        {
                        }

                        break;

                    case "netLog":
                        NetLog.WriteTextLog(operatorID, "【查验发票】", "【" + context.Request.Form["pData[msg]"] + "】:" + context.Request.Form["pData[fpdm]"]);
                        break;
                    }
                }
                catch (Exception ex)
                {
                    json = ex.Message;
                }

                context.Response.Write(json);
            }
        }
Пример #6
0
        protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            //GridView1.PageIndex = e.NewPageIndex;
            //GridView1.DataBind();
            // 得到该控件
            GridView theGrid      = sender as GridView;
            int      newPageIndex = 0;

            if (e.NewPageIndex == -3)
            {
                //点击了Go按钮
                TextBox txtNewPageIndex = null;

                //GridView较DataGrid提供了更多的API,获取分页块可以使用BottomPagerRow 或者TopPagerRow,当然还增加了HeaderRow和FooterRow
                GridViewRow pagerRow = theGrid.BottomPagerRow;

                if (pagerRow != null)
                {
                    //得到text控件
                    txtNewPageIndex = pagerRow.FindControl("txtNewPageIndex") as TextBox;
                }
                if (txtNewPageIndex != null)
                {
                    //得到索引
                    newPageIndex = int.Parse(txtNewPageIndex.Text) - 1;
                }
            }
            else
            {
                //点击了其他的按钮
                newPageIndex = e.NewPageIndex;
            }
            //防止新索引溢出
            newPageIndex = newPageIndex < 0 ? 0 : newPageIndex;
            newPageIndex = newPageIndex >= theGrid.PageCount ? theGrid.PageCount - 1 : newPageIndex;

            //得到新的值
            theGrid.PageIndex = newPageIndex;

            //发票类型代码:00所有/01专票/04普票
            string invoiceType = this.DropDownList1.SelectedValue.ToString();
            //起始日期
            string startDate = this.startDate.Text;
            //结束日期
            string endDate    = this.endDate.Text;
            string operatorID = Request.LogonUserIdentity.Name;

            if (invoiceType != "" && startDate != "" && endDate != "" && operatorID != "")
            {
                //重新绑定
                DataSet ds = DataOperate.queryInvoiceInfo(invoiceType, startDate, endDate, operatorID);
                GridView1.DataSource   = ds.Tables[0];
                GridView1.DataKeyNames = new string[] { "InvoiceCode", "InvoiceNumber" };//主键
                theGrid.DataBind();
                if (!(ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0))
                {
                    Response.Write("<script language=javascript>alert('该时间段内没有该类型发票!');</script>");
                }
            }
            else
            {
                Response.Write("<script language=javascript>alert('请完善查询起止日期!');</script>");
            }
        }
Пример #7
0
        protected void export_Click(object sender, EventArgs e)
        {
            string style = @"<style type=""text/css"">td{mso-number-format:'\@';text-align:center;}</style>";

            //从页面取到查询条件
            //发票类型代码:00所有/01专票/04普票
            string invoiceType = this.DropDownList1.SelectedValue.ToString();
            //起始日期
            string startDate = this.startDate.Text;
            //结束日期
            string endDate = this.endDate.Text;
            //填充数据源
            string operatorID = Request.LogonUserIdentity.Name;

            if (invoiceType != "" && startDate != "" && endDate != "" && operatorID != "")
            {
                DataSet ds = DataOperate.exportInvoiceInfo(invoiceType, startDate, endDate, operatorID);
                if (!(ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0))
                {
                    Response.Write("<script language=javascript>alert('该时间段内没有该类型发票!');</script>");
                }
                else
                {
                    Response.ClearContent();
                    //Response.Buffer = true;
                    //Response.Charset = "gb2312";
                    //Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
                    Response.Charset         = "UTF-8";
                    Response.ContentEncoding = System.Text.Encoding.UTF8;
                    Response.AddHeader("content-disposition", "attachment; filename=export.xls");
                    Response.ContentType = "application/ms-excel";
                    StringWriter   sw   = new StringWriter();
                    HtmlTextWriter htw  = new HtmlTextWriter(sw);
                    StringWriter   sw2  = new StringWriter();
                    HtmlTextWriter htw2 = new HtmlTextWriter(sw2);
                    //导出前将GridView排序和分页都关闭
                    GridView1.AllowPaging  = false;
                    GridView1.AllowSorting = false;
                    GridView1.DataSource   = ds.Tables[0];
                    GridView2.DataSource   = ds.Tables[1];
                    //绑定数据源
                    GridView1.DataBind();
                    GridView2.DataBind();
                    // 清除GridView1中的所有控件,以便导出Excel
                    ClearControls(GridView1);
                    GridView1.RenderControl(htw);
                    GridView2.RenderControl(htw2);
                    //Style为导出Excel时的格式(有个五六种吧,去网上查一下)
                    Response.Write(style);
                    Response.Write(sw.ToString());
                    Response.Write(sw2.ToString());
                    Response.Flush();
                    Response.End();
                    //导出前将GridView分页打开
                    GridView1.AllowPaging  = true;
                    GridView1.AllowSorting = false;
                    //重新绑定数据源
                    //DataSet ds = DataOperate.queryInvoiceInfo("61106", "20170101", "20171231");
                    GridView1.DataSource   = ds.Tables[0];
                    GridView1.DataKeyNames = new string[] { "InvoiceCode", "InvoiceNumber" };//主键
                    GridView1.DataBind();
                }
            }
            else
            {
                Response.Write("<script language=javascript>alert('请完善查询起止日期!');</script>");
            }
        }
Пример #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string json = "";

            if (Request.Form.Count > 20)
            {
                InvoiceInfo info = new InvoiceInfo();
                #region 数据
                if (Request.Form["pData[InvoiceProvince]"] != null)
                {
                    info.InvoiceProvince = Request.Form["pData[InvoiceProvince]"];
                }
                if (Request.Form["pData[InvoiceType]"] != null)
                {
                    info.InvoiceType = Request.Form["pData[InvoiceType]"];
                }
                if (Request.Form["pData[InvoiceCode]"] != null)
                {
                    info.InvoiceCode = Request.Form["pData[InvoiceCode]"];
                }
                if (Request.Form["pData[InvoiceNumber]"] != null)
                {
                    info.InvoiceNumber = Request.Form["pData[InvoiceNumber]"];
                }
                if (Request.Form["pData[InvoiceDate]"] != null)
                {
                    info.InvoiceDate = Request.Form["pData[InvoiceDate]"];
                }
                if (Request.Form["pData[CheckCode]"] != null)
                {
                    info.CheckCode = Request.Form["pData[CheckCode]"];
                }
                if (Request.Form["pData[MachineNumber]"] != null)
                {
                    info.MachineNumber = Request.Form["pData[MachineNumber]"];
                }
                if (Request.Form["pData[GName]"] != null)
                {
                    info.GName = Request.Form["pData[GName]"];
                }
                if (Request.Form["pData[GIdentificationCode]"] != null)
                {
                    info.GIdentificationCode = Request.Form["pData[GIdentificationCode]"];
                }
                if (Request.Form["pData[GAddressPhone]"] != null)
                {
                    info.GAddressPhone = Request.Form["pData[GAddressPhone]"];
                }
                if (Request.Form["pData[GBankAccount]"] != null)
                {
                    info.GBankAccount = Request.Form["pData[GBankAccount]"];
                }
                if (Request.Form["pData[PasswordArea]"] != null)
                {
                    info.PasswordArea = Request.Form["pData[PasswordArea]"];
                }
                if (Request.Form["pData[TotalPriceB]"] != null)
                {
                    info.TotalPriceB = Request.Form["pData[TotalPriceB]"];
                }
                if (Request.Form["pData[TotalPriceS]"] != null)
                {
                    info.TotalPriceS = Request.Form["pData[TotalPriceS]"];
                }
                if (Request.Form["pData[XName]"] != null)
                {
                    info.XName = Request.Form["pData[XName]"];
                }
                if (Request.Form["pData[XIdentificationCode]"] != null)
                {
                    info.XIdentificationCode = Request.Form["pData[XIdentificationCode]"];
                }
                if (Request.Form["pData[XAddressPhone]"] != null)
                {
                    info.XAddressPhone = Request.Form["pData[XAddressPhone]"];
                }
                if (Request.Form["pData[XBankAccount]"] != null)
                {
                    info.XBankAccount = Request.Form["pData[XBankAccount]"];
                }
                if (Request.Form["pData[InspectionTimes]"] != null)
                {
                    info.InspectionTimes = Request.Form["pData[InspectionTimes]"];
                }
                if (Request.Form["pData[InspectionTime]"] != null)
                {
                    info.InspectionTime = Request.Form["pData[InspectionTime]"];
                }
                if (Request.Form["pData[Remark]"] != null)
                {
                    info.Remark = Request.Form["pData[Remark]"];
                }
                #endregion
                List <InvoiceSubInfo> LsubInfo = new List <InvoiceSubInfo>();
                if (Request.Form["pData[InvoiceSubInfo][0][InvoiceCode]"] != null)
                {
                    for (int i = 0; i < 100; i++)
                    {
                        InvoiceSubInfo subInfo = new InvoiceSubInfo();
                        #region 子数据
                        if (string.IsNullOrEmpty(Request.Form["pData[InvoiceSubInfo][" + i + "][InvoiceCode]"]))
                        {
                            break;
                        }
                        if (Request.Form["pData[InvoiceSubInfo][" + i + "][InvoiceCode]"] != null)
                        {
                            subInfo.InvoiceCode = Request.Form["pData[InvoiceSubInfo][" + i + "][InvoiceCode]"];
                        }
                        if (Request.Form["pData[InvoiceSubInfo][" + i + "][InvoiceNumber]"] != null)
                        {
                            subInfo.InvoiceNumber = Request.Form["pData[InvoiceSubInfo][" + i + "][InvoiceNumber]"];
                        }
                        if (Request.Form["pData[InvoiceSubInfo][" + i + "][CheckCode]"] != null)
                        {
                            subInfo.CheckCode = Request.Form["pData[InvoiceSubInfo][" + i + "][CheckCode]"];
                        }
                        if (Request.Form["pData[InvoiceSubInfo][" + i + "][MachineNumber]"] != null)
                        {
                            subInfo.MachineNumber = Request.Form["pData[InvoiceSubInfo][" + i + "][MachineNumber]"];
                        }
                        if (Request.Form["pData[InvoiceSubInfo][" + i + "][NO]"] != null)
                        {
                            subInfo.NO = i.ToString();
                        }
                        if (Request.Form["pData[InvoiceSubInfo][" + i + "][GoodsName]"] != null)
                        {
                            subInfo.GoodsName = Request.Form["pData[InvoiceSubInfo][" + i + "][GoodsName]"];
                        }
                        if (Request.Form["pData[InvoiceSubInfo][" + i + "][SpecificationModel]"] != null)
                        {
                            subInfo.SpecificationModel = Request.Form["pData[InvoiceSubInfo][" + i + "][SpecificationModel]"];
                        }
                        if (Request.Form["pData[InvoiceSubInfo][" + i + "][Unit]"] != null)
                        {
                            subInfo.Unit = Request.Form["pData[InvoiceSubInfo][" + i + "][Unit]"];
                        }
                        if (Request.Form["pData[InvoiceSubInfo][" + i + "][Quantity]"] != null)
                        {
                            subInfo.Quantity = Request.Form["pData[InvoiceSubInfo][" + i + "][Quantity]"];
                        }
                        if (Request.Form["pData[InvoiceSubInfo][" + i + "][UnitPrice]"] != null)
                        {
                            subInfo.UnitPrice = Request.Form["pData[InvoiceSubInfo][" + i + "][UnitPrice]"];
                        }
                        if (Request.Form["pData[InvoiceSubInfo][" + i + "][Money]"] != null)
                        {
                            subInfo.Money = Request.Form["pData[InvoiceSubInfo][" + i + "][Money]"];
                        }
                        if (Request.Form["pData[InvoiceSubInfo][" + i + "][TaxRate]"] != null)
                        {
                            subInfo.TaxRate = Request.Form["pData[InvoiceSubInfo][" + i + "][TaxRate]"];
                        }
                        if (Request.Form["pData[InvoiceSubInfo][" + i + "][Tax]"] != null)
                        {
                            subInfo.Tax = Request.Form["pData[InvoiceSubInfo][" + i + "][Tax]"];
                        }
                        if (Request.Form["pData[InvoiceSubInfo][" + i + "][Total]"] != null)
                        {
                            subInfo.Total = Request.Form["pData[InvoiceSubInfo][" + i + "][Total]"];
                        }
                        if (Request.Form["pData[InvoiceSubInfo][" + i + "][TotalTax]"] != null)
                        {
                            subInfo.TotalTax = Request.Form["pData[InvoiceSubInfo][" + i + "][TotalTax]"];
                        }
                        #endregion
                        LsubInfo.Add(subInfo);
                    }
                    info.SubInfo = LsubInfo;
                }
                if (info.InvoiceCode != "")
                {
                    DataSet ds = DataOperate.JudgeInvoiceInfo(info);
                    if (ds != null && ds.Tables[0].Rows.Count > 0)
                    {
                        json = "{success:'false',inf:'发票重复'}";
                    }
                    else
                    {
                        if (info.InvoiceType == "01")
                        {
                            DataSet dss = DataOperate.JudgeInvoiceInfoYN(info);
                            if (dss != null && dss.Tables[0].Rows.Count > 0)
                            {
                                int result = DataOperate.InsertInvoiceInfo(info);
                                if (result > 0)
                                {
                                    json = "{success:'true',inf:'发票校验成功'}";
                                }
                                else
                                {
                                    json = "{success:'false',inf:'发票数据存储出错'}";
                                }
                            }
                            else
                            {
                                json = "{success:'false',inf:'发票名称有误'}";
                            }
                        }
                        else
                        {
                            //DataSet dsss = DataOperate.JudgeInvoiceInfoName(info);
                            //if (dsss != null && dsss.Tables[0].Rows.Count > 0)
                            //{
                            int result = DataOperate.InsertInvoiceInfo(info);
                            if (result > 0)
                            {
                                json = "{success:'true',inf:'发票校验成功'}";
                            }
                            else
                            {
                                json = "{success:'false',inf:'发票数据存储出错'}";
                            }
                            //}
                            //else
                            //{
                            //    json = "{success:'false',inf:'发票名称有误'}";
                            //}
                        }
                    }
                }
                Response.Write(json);
                Response.End();
            }
        }