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

📄 healthoperation.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.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using YXShop.BLL;
using System.Collections.Generic;

namespace YXShop.Web.Admin.Article.Health
{
    public partial class HealthOperation : System.Web.UI.Page
    {
        YXShop_Health B_Health = new YXShop_Health();
        protected string QList = "";
        protected string ALIst = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!string.IsNullOrEmpty(Request.QueryString["HID"]))
                {
                    BindData();
                }
            }
        }

        void BindData()
        {
            int hId = int.Parse(Request.QueryString["HID"]);
            List<Model.YXShop_Health> listHealth = B_Health.GetListByColumn("hid", hId);

            if (listHealth.Count > 0)
            {
                txtName.Text = listHealth[0].hTitle;
                txtContent.Text = listHealth[0].hContent;
                txtConclusion.Text = listHealth[0].hConclusion;
                QList = listHealth[0].hQ;
                ALIst = listHealth[0].hA;
            }
        }

        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            Model.YXShop_Health M_Health = new YXShop.Model.YXShop_Health();

            string ValueQ = "";
            string ValueA = "";
            ValueQ += Request.Form["txtQ_1"];
            Get_QOrAValue(out ValueQ, out ValueA);
            M_Health.hTitle = txtName.Text;
            M_Health.hContent = txtContent.Text;
            M_Health.hConclusion = txtConclusion.Text;
            M_Health.hQ = ValueQ;//HFQ.Value;
            M_Health.hA = ValueA;//HFA.Value;
            M_Health.AddTime = DateTime.Now;

            if (!string.IsNullOrEmpty(Request.QueryString["HID"]))
            {
                M_Health.hid = int.Parse(Request.QueryString["HID"]);
                B_Health.Amend(M_Health);
            }
            else
            {
                B_Health.Create(M_Health);
            }
        }

        void Get_QOrAValue(out string ValueQ, out string ValueA)
        {
            int Num = Convert.ToInt32(txtNum.Text);
            ValueQ = "";
            ValueA = "";
            for (int i = 1; i <= Num; i++)
            {
                ValueQ += Request.Form["txtQ_" + i] + "<|>";
                try
                {
                    ValueA += Request.Form["txtA_" + i] + "<|>";
                }
                catch { }
            }
            ValueQ = ValueQ.Remove(ValueQ.LastIndexOf("<|>"));
            ValueA = ValueA.Remove(ValueA.LastIndexOf("<|>"));
        }
    }
}

⌨️ 快捷键说明

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