⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 invoicemanage.aspx.cs

📁 易想商城系统
💻 CS
字号:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Collections.Generic;
using YXShop.BLL;
using YXShop.Model;
using Shop.Web.UI;

namespace YXShop.Web.Admin.Product
{
    public partial class InvoiceManage : System.Web.UI.Page
    {
        BasePage bp = new BasePage();
        protected void Page_Load(object sender, EventArgs e)
        {

            if (!IsPostBack)
            {
                if (Request["Pro_ID"] != null)
                {
                    if (!PowerTree.PowerPass.isPass("001007004", PowerTree.PowerPanel.PowerType.update))
                    {
                        bp.PageError("对不起,你没有编辑发票的权限!", "../index.aspx");
                    }
                    YXShop.BLL.InvoiceManage dataCA = new YXShop.BLL.InvoiceManage();
                    List<YXShop.Model.InvoiceManage> data = dataCA.GetId(Convert.ToInt32(Request["Pro_ID"]));
                    txtfpmc.Text = data[0].IM_Type;
                    if (data[0].IM_Tax == null)
                    {
                        txtsl.Text = string.Empty;
                    }
                    else
                    {
                        String[] ar = data[0].IM_Tax.Split('%');
                        txtsl.Text = ar[0].ToString();
                    }
                }
                else
                {
                    if (!PowerTree.PowerPass.isPass("001007002", PowerTree.PowerPanel.PowerType.add))
                    {
                        bp = new BasePage();
                        bp.PageError("对不起,你没有添加发票的权限!", "../index.aspx");
                    }

                }
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            YXShop.BLL.InvoiceManage dataCA = new YXShop.BLL.InvoiceManage();
            YXShop.Model.InvoiceManage data = new YXShop.Model.InvoiceManage();
            data.IM_Type = txtfpmc.Text.Trim();
            if (txtsl.Text == string.Empty)
            {
                data.IM_Tax = "";
            }
            else
            {
                data.IM_Tax = txtsl.Text.Trim() + "%";
            }
            if (Request["Pro_ID"] != null)
            {
                data.IM_ID = Convert.ToInt32(Request["Pro_ID"]);
                if (dataCA.Amend(data) > 0)
                {
                    bp.PageRight("发票修改成功。", "InvoiceManagelist.aspx");
                }
                HttpContext.Current.Request.UrlReferrer.ToString();
            }
            else
            {
                if(dataCA.Create(data) > 0)
                {
                    bp.PageRight("发票添加成功。", "InvoiceManagelist.aspx");
                }
            }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -