protected void Page_Load(object sender, EventArgs e)
 {
     if (!int.TryParse(this.Page.Request.QueryString["GroupId"], out this.currentGroupId))
     {
         base.GotoResourceNotFound();
     }
     else
     {
         this.BtnAddMembers.Click       += new EventHandler(this.BtnAddMembers_Click);
         this.lkbDelectCheck.Click      += new EventHandler(this.lkbDelectCheck_Click);
         this.grdMemberList.RowDeleting += new GridViewDeleteEventHandler(this.grdMemberList_RowDeleting);
         if (!base.IsPostBack)
         {
             CustomGroupingInfo groupInfoById = CustomGroupingHelper.GetGroupInfoById(this.currentGroupId);
             if (groupInfoById != null)
             {
                 this.GroupName.Text = groupInfoById.GroupName;
                 this.BindData();
             }
             else
             {
                 base.Response.Redirect("CustomDistributorList.aspx");
             }
         }
     }
 }
Exemple #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.localUrl = base.Request.Url.ToString();
     if (!int.TryParse(this.Page.Request.QueryString["GroupId"], out this.currentGroupId))
     {
         base.GotoResourceNotFound();
     }
     else
     {
         this.btnSelect.Click += new EventHandler(this.btnSelect_Click);
         this.btnJoin.Click   += new EventHandler(this.btnJoin_Click);
         if (!base.IsPostBack)
         {
             CustomGroupingInfo groupInfoById = CustomGroupingHelper.GetGroupInfoById(this.currentGroupId);
             if (groupInfoById != null)
             {
                 this.GroupName.Text    = groupInfoById.GroupName;
                 this.resultDiv.Visible = false;
             }
             else
             {
                 this.ShowMsgAndReUrl("参数错误!", false, "CustomDistributorList.aspx");
             }
         }
     }
 }
Exemple #3
0
        protected void btnupdategroup_Click(object sender, EventArgs e)
        {
            int    s   = Globals.ToNum(this.hdgroupId.Value.Trim());
            string str = Globals.HtmlEncode(this.txtgroupname.Text.Trim());

            if (Globals.ToNum(s) <= 0)
            {
                this.ShowMsg("选择的分组有误,请重新选择", false);
            }
            else if (string.IsNullOrEmpty(str))
            {
                this.ShowMsg("分组名称不允许为空", false);
            }
            else
            {
                CustomGroupingInfo customGroupingInfo = new CustomGroupingInfo
                {
                    GroupName = str,
                    Id        = s
                };
                string str2 = CustomGroupingHelper.UpdateCustomGrouping(customGroupingInfo);
                if (Globals.ToNum(str2) > 0)
                {
                    this.ShowMsg("修改商品分组成功", true);
                    this.BindData();
                }
                else
                {
                    this.ShowMsg("修改商品分组失败," + str2, false);
                }
            }
        }
Exemple #4
0
        protected void btnaddgroup_Click(object sender, EventArgs e)
        {
            string str = Globals.HtmlEncode(this.txtaddgroupname.Text.Trim());

            if (string.IsNullOrEmpty(str))
            {
                this.ShowMsg("分组名称不允许为空!", false);
            }
            else
            {
                CustomGroupingInfo customGroupingInfo = new CustomGroupingInfo
                {
                    GroupName = str
                };
                string s = CustomGroupingHelper.AddCustomGrouping(customGroupingInfo);
                if (Globals.ToNum(s) > 0)
                {
                    this.ShowMsg("添加分组成功!", true);
                    this.BindData();
                }
                else
                {
                    this.ShowMsg("添加分组失败," + s, false);
                }
            }
        }
        public string AddCustomGrouping(CustomGroupingInfo customGroupingInfo)
        {
            if (this.GetGroupIdByGroupName(customGroupingInfo.GroupName, 0) > 0)
            {
                return("分组名称已存在");
            }
            DbCommand sqlStringCommand = this.database.GetSqlStringCommand("INSERT INTO Vshop_CustomGrouping(GroupName,Memo)VALUES(@GroupName,@Memo);select @@identity;");

            this.database.AddInParameter(sqlStringCommand, "GroupName", DbType.String, customGroupingInfo.GroupName);
            this.database.AddInParameter(sqlStringCommand, "Memo", DbType.String, customGroupingInfo.Memo);
            return(Globals.ToNum(this.database.ExecuteScalar(sqlStringCommand)).ToString());
        }
        public string UpdateCustomGrouping(CustomGroupingInfo customGroupingInfo)
        {
            if (this.GetGroupIdByGroupName(customGroupingInfo.GroupName, customGroupingInfo.Id) > 0)
            {
                return("分组名称已存在");
            }
            DbCommand sqlStringCommand = this.database.GetSqlStringCommand("Update Vshop_CustomGrouping set GroupName=@GroupName where Id=" + customGroupingInfo.Id);

            this.database.AddInParameter(sqlStringCommand, "GroupName", DbType.String, customGroupingInfo.GroupName);
            this.database.AddInParameter(sqlStringCommand, "Memo", DbType.String, customGroupingInfo.Memo);
            return(Globals.ToNum(this.database.ExecuteNonQuery(sqlStringCommand)).ToString());
        }
        public CustomGroupingInfo GetGroupInfoById(int groupId)
        {
            System.Data.Common.DbCommand sqlStringCommand = this.database.GetSqlStringCommand("select * from Vshop_CustomGrouping where id=@Id");
            this.database.AddInParameter(sqlStringCommand, "Id", System.Data.DbType.String, groupId);
            CustomGroupingInfo result = null;

            using (System.Data.IDataReader dataReader = this.database.ExecuteReader(sqlStringCommand))
            {
                result = ReaderConvert.ReaderToModel <CustomGroupingInfo>(dataReader);
            }
            return(result);
        }
        public string AddCustomGrouping(CustomGroupingInfo customGroupingInfo)
        {
            string result = string.Empty;

            if (this.GetGroupIdByGroupName(customGroupingInfo.GroupName, 0) > 0)
            {
                result = "分组名称已存在";
            }
            else
            {
                System.Data.Common.DbCommand sqlStringCommand = this.database.GetSqlStringCommand("INSERT INTO Vshop_CustomGrouping(GroupName,Memo)VALUES(@GroupName,@Memo);select @@identity;");
                this.database.AddInParameter(sqlStringCommand, "GroupName", System.Data.DbType.String, customGroupingInfo.GroupName);
                this.database.AddInParameter(sqlStringCommand, "Memo", System.Data.DbType.String, customGroupingInfo.Memo);
                result = Globals.ToNum(this.database.ExecuteScalar(sqlStringCommand)).ToString();
            }
            return(result);
        }
        public string UpdateCustomGrouping(CustomGroupingInfo customGroupingInfo)
        {
            string result = string.Empty;

            if (this.GetGroupIdByGroupName(customGroupingInfo.GroupName, customGroupingInfo.Id) > 0)
            {
                result = "分组名称已存在";
            }
            else
            {
                System.Data.Common.DbCommand sqlStringCommand = this.database.GetSqlStringCommand("Update Vshop_CustomGrouping set GroupName=@GroupName where Id=" + customGroupingInfo.Id);
                this.database.AddInParameter(sqlStringCommand, "GroupName", System.Data.DbType.String, customGroupingInfo.GroupName);
                this.database.AddInParameter(sqlStringCommand, "Memo", System.Data.DbType.String, customGroupingInfo.Memo);
                result = Globals.ToNum(this.database.ExecuteNonQuery(sqlStringCommand)).ToString();
            }
            return(result);
        }
Exemple #10
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     if (!int.TryParse(this.Page.Request.QueryString["GroupId"], out this.currentGroupId))
     {
         base.GotoResourceNotFound();
         return;
     }
     this.BtnAddMembers.Click       += new System.EventHandler(this.BtnAddMembers_Click);
     this.lkbDelectCheck.Click      += new System.EventHandler(this.lkbDelectCheck_Click);
     this.grdMemberList.RowDeleting += new System.Web.UI.WebControls.GridViewDeleteEventHandler(this.grdMemberList_RowDeleting);
     if (!base.IsPostBack)
     {
         CustomGroupingInfo groupInfoById = CustomGroupingHelper.GetGroupInfoById(this.currentGroupId);
         this.GroupName.Text = groupInfoById.GroupName;
         this.BindData();
     }
 }
Exemple #11
0
 protected string GetMemberCustomGroup()
 {
     System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
     System.Collections.Generic.IList <CustomGroupingInfo> customGroupingList = CustomGroupingHelper.GetCustomGroupingList();
     if (customGroupingList != null && customGroupingList.Count > 0)
     {
         using (System.Collections.Generic.IEnumerator <CustomGroupingInfo> enumerator = customGroupingList.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 CustomGroupingInfo current = enumerator.Current;
                 stringBuilder.Append(" <label class=\"middle mr20\">");
                 stringBuilder.AppendFormat("<input type=\"checkbox\" class=\"CustomGroup\" value=\"{0}\">{1}", current.Id, current.GroupName);
                 stringBuilder.Append("  </label>");
             }
             goto IL_7D;
         }
     }
     stringBuilder.Append("暂无分组信息,去<a href='../member/CustomDistributorList.aspx'>创建新分组</a>");
     IL_7D:
     return(stringBuilder.ToString());
 }
Exemple #12
0
 public static string UpdateCustomGrouping(CustomGroupingInfo customGroupingInfo)
 {
     return(new CustomGroupingDao().UpdateCustomGrouping(customGroupingInfo));
 }
Exemple #13
0
 public static string AddCustomGrouping(CustomGroupingInfo customGroupingInfo)
 {
     return(new CustomGroupingDao().AddCustomGrouping(customGroupingInfo));
 }