Example #1
0
    protected void btnUpdateOrder_Click(object sender, EventArgs e)
    {
        int order = 0;
        string orderValue ="";
        int userGradeId =0;

        XYECOM.Model.UserGradeInfo ugInfo = null;
        XYECOM.Business.UserGrade ugBLL = new UserGrade();

        foreach (GridViewRow GR in this.gvlist.Rows)
        {
            orderValue = ((TextBox)(GR.FindControl("txtOrder"))).Text.Trim();

            order = XYECOM.Core.MyConvert.GetInt32(orderValue);

            userGradeId =XYECOM.Core.MyConvert.GetInt32(gvlist.DataKeys[GR.DataItemIndex].Value.ToString());

            if (userGradeId <= 0) continue;

            ugInfo = ugBLL.GetItem(userGradeId);

            if (ugInfo == null) continue;

            ugInfo.OrderId = order;

            ugBLL.Update(ugInfo);
        }

        BindData();
    }
Example #2
0
    protected void btnOk_ServerClick1(object sender, EventArgs e)
    {
        XYECOM.Model.UserGradeInfo eu = new XYECOM.Model.UserGradeInfo();
        XYECOM.Business.UserGrade ug = new XYECOM.Business.UserGrade();

        eu.GradeName = this.txtName.Text;
        eu.AnnualRent = Convert.ToDecimal(this.ymoney.Text);
        eu.MonthlyRent = Convert.ToDecimal(this.mmoney.Text);
        eu.SmallIconName = this.tbsmall.Text;
        eu.BigIconName = tbbig.Text;

        string url = "UserGrade.aspx";

        int UG_ID = 0;
        int i = ug.Insert(eu, out UG_ID);

        if (i >= 0)
        {
            XYECOM.Model.UserGradePopedomInfo info = new XYECOM.Model.UserGradePopedomInfo();

            info.UG_ID = UG_ID;

            new XYECOM.Business.UserGradePopedom().Insert(info);
            Response.Redirect(url);
        }
        else if (i == -1)
        {
            Alert("该用户等级名已经存在,请重新输入用户等级名!", url);
        }
        else
        {
            Alert("添加失败!", url);
        }
    }
Example #3
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        XYECOM.Business.Log l = new XYECOM.Business.Log();
        XYECOM.Model.LogInfo el = new XYECOM.Model.LogInfo();
        XYECOM.Model.UserGradeInfo eu = new XYECOM.Model.UserGradeInfo();
        XYECOM.Business.UserGrade ug = new XYECOM.Business.UserGrade();
        eu.GradeId = Convert.ToInt16(this.UG_ID.Value);
        eu.GradeName = this.txtname1.Text;
        eu.MonthlyRent = Convert.ToDecimal(this.mmoney1.Text);
        eu.AnnualRent = Convert.ToDecimal(this.ymoney1.Text);
        eu.SmallIconName = this.tbsmall.Text.Trim();
        eu.BigIconName = this.tbbig.Text.Trim();

        int i = 0;
        i = ug.Update(eu);
        string url = "UserGrade.aspx";
        if (i >= 0)
        {
            el.L_Title = "用户等级管理";
            el.L_Content = "修改用户等级成功";
            el.L_MF = "财务管理";
            el.UM_ID = AdminId;
            l.Insert(el);
            Response.Redirect(url);
            this.key.Value = "2";
        }
        else
        {
            el.L_Title = "用户等级管理";
            el.L_Content = "修改用户等级失败";
            el.L_MF = "财务管理";
            el.UM_ID = AdminId;
            l.Insert(el);
            Alert("修改失败!", url);
        }
    }
Example #4
0
 private void Gradedatalist()
 {
     XYECOM.Business.UserGrade ug = new XYECOM.Business.UserGrade();
     this.CBL .DataSource  = ug.GetDataTable();
     this.CBL.DataBind();
 }
Example #5
0
    protected void gvlist_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        XYECOM.Business.UserGrade ug = new XYECOM.Business.UserGrade();
        if (e.CommandName == "up")
        {
            this.key.Value = "2";
            XYECOM.Model.UserGradeInfo eu = new XYECOM.Model.UserGradeInfo();
            this.UG_ID.Value = gvlist.DataKeys[Convert.ToInt16(e.CommandArgument)].Value.ToString();
            eu = ug.GetItem(Convert.ToInt16(gvlist.DataKeys[Convert.ToInt16(e.CommandArgument)].Value.ToString()));

            this.txtname1.Text = eu.GradeName.ToString();
            this.ymoney1.Text = XYECOM.Core.Utils.GetMoney(eu.AnnualRent.ToString());
            this.mmoney1.Text = XYECOM.Core.Utils.GetMoney(eu.MonthlyRent.ToString());
            this.tbsmall.Text = eu.SmallIconName;
            this.tbbig.Text = eu.BigIconName;
        }
        else if (e.CommandName == "del")
        {
            if (new XYECOM.Business.UserGrade().HasSubUser(gvlist.DataKeys[Convert.ToInt16(e.CommandArgument)].Value.ToString()))
            {
                Alert("该等级下已有用户信息,故不能删除!", "UserGrade.aspx");
            }
            else
            {
                int i = 0;
                XYECOM.Business.Log l = new XYECOM.Business.Log();
                XYECOM.Model.LogInfo el = new XYECOM.Model.LogInfo();

                i = ug.Delete(Convert.ToInt16(gvlist.DataKeys[Convert.ToInt16(e.CommandArgument)].Value.ToString()));
                if (i >= 0)
                {
                    el.L_Title = "用户等级管理";
                    el.L_Content = "删除用户等级成功";
                    el.L_MF = "用户等级";

                    {
                        el.UM_ID = AdminId;
                    }
                    l.Insert(el);
                    string url = "UserGrade.aspx";
                    this.key.Value = "3";
                    Response.Redirect(url);
                }
                else
                {
                    el.L_Title = "用户等级管理";
                    el.L_Content = "删除用户等级失败";
                    el.L_MF = "用户等级";

                    {
                        el.UM_ID = AdminId;
                    }
                    l.Insert(el);

                    string url = "UserGrade.aspx";
                    Alert("删除失败!", url);
                }
            }
        }
    }
Example #6
0
    protected void btadd_Click(object sender, EventArgs e)
    {
        bool isUpdate = false;
        if (XYECOM.Core.XYRequest.GetQueryString("action") == "edit") isUpdate = true;

        XYECOM.Business.UserGrade ugBLL = new XYECOM.Business.UserGrade();
        List<XYECOM.Model.UserGradeInfo> infos = ugBLL.GetItems();

        XYECOM.Business.ChargeNewsSet cnBLL = new XYECOM.Business.ChargeNewsSet();
        XYECOM.Model.ChargeNewsSetInfo cnInfo = new XYECOM.Model.ChargeNewsSetInfo();

        bool isShowChargeNews = false;

        string newsIds = this.nsid.Value;

        this.nsid.Value = newsIds;

        string[] aryIds = newsIds.Split('|');

        long newsId = 0;

        foreach (string s in aryIds)
        {
            newsId = XYECOM.Core.MyConvert.GetInt64(s);

            foreach (XYECOM.Model.UserGradeInfo info in infos)
            {
                isShowChargeNews = XYECOM.Business.UserGradePopedom.IsShowChargeNews(info.GradeId);

                if (!isShowChargeNews) continue;

                if (isUpdate) cnInfo = cnBLL.GetItem(newsId, info.GradeId);

                if (cnInfo == null)
                {
                    cnInfo = new ChargeNewsSetInfo();
                    isUpdate = false;
                }

                TextBox txt = (TextBox)phMain.FindControl("txtWebMoney" + info.GradeId);
                cnInfo.CN_ConsumeWebMoney = XYECOM.Core.MyConvert.GetInt32(txt.Text.Trim());

                txt = (TextBox)phMain.FindControl("txtMoney" + info.GradeId);
                cnInfo.CN_ConsumeMoney = XYECOM.Core.MyConvert.GetInt32(txt.Text.Trim());

                if (!isUpdate && newsId > 0)
                {
                    cnInfo.CN_VisitPopedom = (short)info.GradeId;
                    cnInfo.NS_ID = newsId;
                    cnBLL.Insert(cnInfo);
                }
                else
                    cnBLL.Update(cnInfo);

                cnInfo = null;
                if (XYECOM.Core.XYRequest.GetQueryString("action") == "edit") isUpdate = true;
            }

            //更新表,使HTML页面字段保持为空
            XYECOM.Core.Function.UpdateColumuByWhere("NS_HTMLPage", "", " where NS_ID=" + this.nsid.Value, "n_news");
        }

        Alert("收费新闻设置成功", backURL);
    }
Example #7
0
    private void InitPageControl(long newsId)
    {
        XYECOM.Business.UserGrade ugBLL = new XYECOM.Business.UserGrade();
        List<XYECOM.Model.UserGradeInfo> infos =  ugBLL.GetItems();

        Table t = new Table();

        TableRow row = new TableRow();
        TableCell cell = new TableCell();
        row.CssClass = "vtop";

        cell.Text = "用户组";
        row.Cells.Add(cell);

        cell = new TableCell();

        cell.Text = "扣除虚拟货币数";
        row.Cells.Add(cell);

        cell = new TableCell();
        cell.Text = "扣除现金货币数";
        row.Cells.Add(cell);

        t.Rows.Add(row);

        XYECOM.Business.ChargeNewsSet cnBLL = new XYECOM.Business.ChargeNewsSet();
        XYECOM.Model.ChargeNewsSetInfo cnInfo = new XYECOM.Model.ChargeNewsSetInfo();

        bool isShowChargeNews = false;

        foreach (XYECOM.Model.UserGradeInfo info in infos)
        {
            isShowChargeNews = XYECOM.Business.UserGradePopedom.IsShowChargeNews(info.GradeId);

            row = new TableRow();
            cell = new TableCell();
            row.CssClass = "vtop";

            if (newsId == 0)
                cnInfo = new ChargeNewsSetInfo();
            else
                cnInfo = cnBLL.GetItem(newsId, info.GradeId);

            if(cnInfo == null) cnInfo = new ChargeNewsSetInfo();

            System.Web.UI.WebControls.Label lblGradeName = new System.Web.UI.WebControls.Label();
            lblGradeName.Enabled = isShowChargeNews;
            lblGradeName.ID = "lblGradeId" + info.GradeId;
            lblGradeName.Text = info.GradeName;
            cell.Controls.Add(lblGradeName);
            row.Cells.Add(cell);

            cell = new TableCell();
            TextBox txtWebMoney = new TextBox();
            txtWebMoney.Enabled = isShowChargeNews;
            txtWebMoney.Columns = 5;
            txtWebMoney.MaxLength = 4;
            txtWebMoney.ID = "txtWebMoney" + info.GradeId;
            txtWebMoney.Text = cnInfo.CN_ConsumeWebMoney.ToString();
            cell.Controls.Add(txtWebMoney);

            RangeValidator rv = new RangeValidator();
            rv.ControlToValidate = "txtWebMoney" + info.GradeId;
            rv.ErrorMessage = "*";
            rv.MaximumValue = "9999";
            rv.MinimumValue = "0";
            rv.Type = ValidationDataType.Integer;

            cell.Controls.Add(rv);

            row.Cells.Add(cell);

            cell = new TableCell();
            TextBox txtMoney = new TextBox();
            txtMoney.Enabled = isShowChargeNews;
            txtMoney.Columns = 5;
            txtMoney.MaxLength = 4;
            txtMoney.ID = "txtMoney" + info.GradeId;
            txtMoney.Text = cnInfo.CN_ConsumeMoney.ToString();
            cell.Controls.Add(txtMoney);

            RangeValidator rv1 = new RangeValidator();
            rv1.ControlToValidate = "txtMoney" + info.GradeId;
            rv1.ErrorMessage = "*";
            rv1.MaximumValue = "9999";
            rv1.MinimumValue = "0";
            rv1.Type = ValidationDataType.Integer;

            cell.Controls.Add(rv1);

            row.Cells.Add(cell);

            t.Rows.Add(row);
        }

        this.phMain.Controls.Add(t);
    }
Example #8
0
    private void DDLBind()
    {
        XYECOM.Business.UserGrade ugread = new UserGrade();

        this.ddldebaseusergrade.DataSource = ugread.GetItems();

        if (ugread.GetItems().Count > 0)
        {
            foreach (XYECOM.Model.UserGradeInfo info in ugread.GetItems())
            {
                this.ddldebaseusergrade.Items.Add(new ListItem(info.GradeName.Trim(), info.GradeId.ToString()));
            }
        }
        this.ddldebaseusergrade.Items.Insert(0, new ListItem("请选择", ""));
    }