Пример #1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            M_ShopGrade mshopgrade = new M_ShopGrade();

            if (this.HdnModelId.Value == "0")
            {
                mshopgrade.ID         = 0;
                mshopgrade.GradeName  = this.GradeName.Text;
                mshopgrade.Gradeimg   = this.TxtGradeimg.Text;
                mshopgrade.CommentNum = DataConverter.CLng(TxtCommentNum.Text);
                mshopgrade.OtherName  = this.TxtOtherName.Text;
                mshopgrade.Istrue     = DataConverter.CBool(this.IsTrue.Text);
                mshopgrade.GradeType  = DataConverter.CLng(Request.Form["GradeType"]);
                mshopgrade.Imgnum     = DataConverter.CLng(this.Imgnum.Text);
                bshopgrade.AddShopGrade(mshopgrade);
                Response.Write("<script language=javascript>alert('添加成功!请继续添加!');location.href='AddShopGrades.aspx';</script>");
            }
            else
            {
                mshopgrade.ID         = DataConverter.CLng(this.HdnModelId.Value);
                mshopgrade.GradeName  = this.GradeName.Text;
                mshopgrade.Gradeimg   = this.TxtGradeimg.Text;
                mshopgrade.CommentNum = DataConverter.CLng(TxtCommentNum.Text);
                mshopgrade.OtherName  = this.TxtOtherName.Text;
                mshopgrade.Istrue     = DataConverter.CBool(this.IsTrue.Text);
                mshopgrade.GradeType  = DataConverter.CLng(Request.Form["GradeType"]);
                mshopgrade.Imgnum     = DataConverter.CLng(this.Imgnum.Text);
                bshopgrade.UpdateShopGrade(mshopgrade);
                Response.Write("<script language=javascript>alert('修改成功!');location.href='ShopGrade.aspx';</script>");
            }
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string str = "添加等级";

            if (!this.Page.IsPostBack)
            {
                B_Admin badmin = new B_Admin();

                if (!B_ARoleAuth.Check(ZLEnum.Auth.store, "StoreProductManage"))
                {
                    function.WriteErrMsg("没有权限进行此项操作");
                }
                if (!B_ARoleAuth.Check(ZLEnum.Auth.model, "ModelEdit"))
                {
                    function.WriteErrMsg("没有权限进行此项操作");
                }
                //foreach (DataRow row in FileSystemObject.GetDirectoryAllInfos(HttpContext.Current.Server.MapPath("/Images/levelIcon/"), FsoMethod.File).Rows)
                //{
                //    this.DrpGradeimg.Items.Add(new ListItem(row["name"].ToString(), row["name"].ToString()));
                //}
                this.DrpGradeimg.Attributes.Add("onchange", "ChangeImgItemIcon(this.value);ChangeTxtItemIcon(this.value);");
                this.TxtGradeimg.Attributes.Add("onchange", "ChangeImgItemIcon(this.value);");
                string id = base.Request.QueryString["ID"];
                if (!string.IsNullOrEmpty(id))
                {
                    this.HdnModelId.Value = id;
                    str = "修改等级";
                    this.LTitle.Text = "修改等级";
                    M_ShopGrade info = this.bshopgrade.GetShopGradebyid(int.Parse(id));
                    this.GradeName.Text = info.GradeName.ToString();
                    string selectValue = string.IsNullOrEmpty(info.Gradeimg) ? "m_1.gif" : info.Gradeimg;
                    this.ImgGradeimg.ImageUrl      = "/Images/levelIcon/" + selectValue;
                    this.TxtGradeimg.Text          = info.Gradeimg.ToString();
                    this.TxtCommentNum.Text        = info.CommentNum.ToString();
                    this.TxtOtherName.Text         = info.OtherName.ToString();
                    this.IsTrue.Text               = info.Istrue.ToString();
                    this.GradeType.Text            = info.GradeType.ToString();
                    this.DrpGradeimg.SelectedValue = selectValue;
                    this.Imgnum.Text               = info.Imgnum.ToString();
                }
                else
                {
                    this.HdnModelId.Value = "0";
                }
            }
            Call.SetBreadCrumb(Master, "<li><a href='" + CustomerPageAction.customPath2 + "Main.aspx'>工作台</a></li><li><a href='StoreManage.aspx'>店铺管理</a><li><a href='ShopGrade.aspx'>店铺等级管理</a></li><li class='active'>" + str + "</li>");
        }
Пример #3
0
        public M_ShopGrade Getbyrow(DataTable info)
        {
            M_ShopGrade cc = new M_ShopGrade();

            if (info.Rows.Count > 0)
            {
                cc.ID         = DataConverter.CLng(info.Rows[0]["ID"].ToString());
                cc.GradeName  = info.Rows[0]["GradeName"].ToString();
                cc.Gradeimg   = info.Rows[0]["Gradeimg"].ToString();
                cc.CommentNum = DataConverter.CLng(info.Rows[0]["CommentNum"].ToString());
                cc.OtherName  = info.Rows[0]["OtherName"].ToString();
                cc.Istrue     = DataConverter.CBool(info.Rows[0]["Istrue"].ToString());
                cc.GradeType  = DataConverter.CLng(info.Rows[0]["GradeType"].ToString());
                cc.Imgnum     = DataConverter.CLng(info.Rows[0]["Imgnum"].ToString());
            }
            return(cc);
        }
Пример #4
0
 public int insert(M_ShopGrade model)
 {
     return(Sql.insertID(TbName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Пример #5
0
 /// <summary>
 /// 根据ID更新
 /// </summary>
 public bool UpdateByID(M_ShopGrade model)
 {
     return(Sql.UpdateByIDs(TbName, PK, model.ID.ToString(), BLLCommon.GetFieldAndPara(model), model.GetParameters()));
 }
Пример #6
0
 public bool AddShopGrade(M_ShopGrade model)
 {
     Sql.insertID(TbName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model));
     return(true);
 }