Beispiel #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();
    }
Beispiel #2
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);
                }
            }
        }
    }