// 清除所选内容
        protected void btnClear_Click(object sender, EventArgs e)
        {
            string ids = Request.Form["idchk"];

            if (!string.IsNullOrEmpty(ids))
            {
                foreach (string id in ids.Split(','))
                {
                    contentBll.DelContent(DataConvert.CLng(id));
                }
            }
            MyBind();
        }
Beispiel #2
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            try
            {
                Button   bt     = sender as Button;
                string   type   = bt.CommandName;
                string[] chkArr = GetChecked();
                if (chkArr != null)
                {
                    for (int i = 0; i < chkArr.Length; i++)
                    {
                        M_CommonData cinfo = cbll.GetCommonData(Convert.ToInt32(chkArr[i]));
                        switch (type)
                        {
                        case "1"://推荐
                            cinfo.EliteLevel = 1;
                            cinfo.Status     = 99;
                            cbll.Update(cinfo);
                            break;

                        case "2"://关闭
                            cinfo.Status = -1;
                            cbll.Update(cinfo);
                            break;

                        case "3"://取消推荐
                            cinfo.EliteLevel = 0;
                            cbll.Update(cinfo);
                            break;

                        case "4"://取消关闭
                            cinfo.Status = 99;
                            cbll.Update(cinfo);
                            break;

                        case "5"://批量删除
                            cbll.DelContent(Convert.ToInt32(chkArr[i]));
                            break;
                        }
                    }
                    DataBind();
                }
            }
            catch (Exception ee)
            {
                function.WriteErrMsg(ee.Message);
            }
        }
Beispiel #3
0
        public ContentResult ContentManage_API()
        {
            string action = GetParam("action");
            string ids    = GetParam("ids");

            switch (action)
            {
            case "move":
                string direct = Request.Form["direct"];
                int    curid = DataConvert.CLng(Request.Form["curid"]), tarid = DataConvert.CLng(Request.Form["tarid"]);

                M_CommonData curMod = contentBll.GetCommonData(curid);
                M_CommonData tarMod = contentBll.GetCommonData(tarid);
                if (curMod.OrderID == tarMod.OrderID)
                {
                    switch (direct)
                    {
                    case "up":
                        curMod.OrderID++;
                        break;

                    case "down":
                        curMod.OrderID--;
                        break;
                    }
                }
                else
                {
                    int temp = curMod.OrderID;
                    curMod.OrderID = tarMod.OrderID;
                    tarMod.OrderID = temp;
                }
                contentBll.UpdateByID(curMod); contentBll.UpdateByID(tarMod);
                return(Content("true"));

            case "del":
                contentBll.DelContent(ids, "");
                break;

            case "recover":
                contentBll.Reset(ids);
                break;

            case "clear":
                contentBll.DelRecycle();
                break;

            default:
                break;
            }
            return(Content(Success.ToString()));
        }
Beispiel #4
0
        protected void EGV_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int id = DataConverter.CLng(e.CommandArgument);

            switch (e.CommandName.ToLower())
            {
            case "del2":
                bll.DelContent(id);
                break;

            case "reset":
                bll.Reset(id);
                break;
            }
            MyBind();
        }
Beispiel #5
0
        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            B_Content        bcon   = new B_Content();
            LinkButton       lb     = (LinkButton)sender;
            GridViewRow      gvr    = (GridViewRow)lb.NamingContainer;
            M_CollectionInfo mc     = bc.GetSelect(DataConverter.CLng(Egv.DataKeys[gvr.RowIndex].Value));
            DataTable        dtitem = bcon.GetCommonByItem(mc.ModeID, mc.NodeID, mc.CollID);

            if (dtitem.Rows.Count > 0)
            {
                int gid = DataConverter.CLng(dtitem.Rows[0]["GeneralID"].ToString());
                bcon.DelContent(gid);
                bc.GetDelete(mc.C_IID);
            }
            myBind();
        }
Beispiel #6
0
        protected void EGV_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            switch (e.CommandName.ToLower())
            {
            case "read":
                Response.Redirect("../ViewContent.aspx?Gid=" + e.CommandArgument.ToString());
                break;

            case "recover":
                bll.UpdateStatus(Convert.ToInt32(e.CommandArgument), 99);
                break;

            case "del2":
                bll.DelContent(Convert.ToInt32(e.CommandArgument));
                break;
            }
            DataBind();
        }
Beispiel #7
0
        public ContentResult Store_API()
        {
            string action = GetParam("action");
            string ids    = Request.Form["idchk"];

            if (string.IsNullOrEmpty(ids))
            {
                return(Content(Failed.ToString()));
            }
            string[] idArr = ids.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
            foreach (string idStr in idArr)
            {
                int id = Convert.ToInt32(idStr);
                switch (action)
                {
                case "audit":    //批量审核
                    conBll.UpdateStatus(id, (int)ZLEnum.ConStatus.Audited);
                    break;

                case "unaudit":    //取消审核
                    conBll.UpdateStatus(id, (int)ZLEnum.ConStatus.Reject);
                    break;

                case "elite":    //批量推荐
                    conBll.UpdateStatus(id, (int)ZLEnum.ConStatus.Audited);
                    conBll.UpdateElite(idStr, 1);
                    break;

                case "unelite":    //取消推荐
                    conBll.UpdateElite(idStr, 0);
                    break;

                case "del":    //批量删除
                    conBll.DelContent(id);
                    break;
                }
            }
            return(Content(Success.ToString()));
        }
Beispiel #8
0
 public int Content_RealDel(string ids)
 {
     conBll.DelContent(ids, mu.UserName);
     return(Success);
 }
Beispiel #9
0
    //初始化
    private void GetInit()
    {
        DataTable shopinfo = mfbll.SelectTableName("ZL_CommonModel", "where tablename like 'ZL_Store_%' and Inputer='" + ubll.GetLogin().UserName + "'");

        if (shopinfo.Rows.Count < 1)
        {
            Response.Redirect("StoreApply.aspx");//申请店铺
        }
        else
        {
            ViewState["gid"] = shopinfo.Rows[0]["GeneralID"].ToString();
            this.Label2.Text = "<a href=\"/Store/StoreIndex.aspx?id=" + shopinfo.Rows[0]["GeneralID"].ToString() + "\" target=\"_blank\">浏览店铺</a>";
            if (shopinfo.Rows[0]["Status"].ToString() != "99")
            {
                Response.Redirect("StoreEdit.aspx");
            }
            else
            {
                int       id        = Convert.ToInt32(shopinfo.Rows[0]["ItemID"].ToString());
                string    TableName = shopinfo.Rows[0]["TableName"].ToString();
                DataTable st        = Sql.Sel(TableName, "ID=" + id, "");
                if (st.Rows.Count != 0)
                {
                    this.Nametxt.Text = st.Rows[0]["StoreName"].ToString();
                }
                else
                {
                    this.Nametxt.Text = "";
                }

                DataTable modeinfo = mfbll.SelectTableName("ZL_Model", "where TableName='" + TableName + "'");
                if (modeinfo.Rows.Count > 0)
                {
                    DataTable cmdinfo = cbll.GetContent(gid);
                    if (cmdinfo.Rows.Count > 0)
                    {
                        this.Label3.Text = cmdinfo.Rows[0]["StoreCredit"].ToString();
                        this.Label4.Text = GetState(cmdinfo.Rows[0]["StoreCommendState"].ToString());
                        M_ModelInfo mi = bmll.GetModelById(int.Parse(cmdinfo.Rows[0]["StoreModelID"].ToString()));
                        this.Label1.Text = mi.ModelName;
                        //DataTable slist = sstbll.GetStyleByModel(int.Parse(cmdinfo.Rows[0]["StoreModelID"].ToString()), 1);
                        DataTable slist = sstbll.GetStyleByModel(int.Parse(cmdinfo.Rows[0]["StoreModelID"].ToString()), 1);

                        this.HiddenField1.Value         = cmdinfo.Rows[0]["StoreModelID"].ToString();
                        this.SSTDownList.DataSource     = slist;
                        this.SSTDownList.DataTextField  = "StyleName";
                        this.SSTDownList.DataValueField = "ID";
                        this.SSTDownList.DataBind();
                        this.SSTDownList.SelectedValue = cmdinfo.Rows[0]["StoreStyleID"].ToString();
                        M_StoreStyleTable sst = sstbll.GetStyleByID(int.Parse(cmdinfo.Rows[0]["StoreStyleID"].ToString()));
                        this.Image1.ImageUrl = "~/UploadFiles/" + sst.StylePic;
                        if (cmdinfo.Rows.Count > 0)
                        {
                            this.ModelHtml.Text = this.mfbll.GetUpdateHtmlUser(int.Parse(cmdinfo.Rows[0]["StoreModelID"].ToString()), 0, cmdinfo);
                        }
                        else
                        {
                            this.ModelHtml.Text = this.mfbll.GetInputHtmlUser(int.Parse(cmdinfo.Rows[0]["StoreModelID"].ToString()), 0);
                        }
                        //function.WriteErrMsg(ModelHtml.Text.ToString().Replace("<","左"));
                    }
                }
                else
                {
                    cbll.DelContent(gid);
                    Response.Redirect("Default.aspx");
                    this.Label3.Text = "不可用";
                    this.Label4.Text = "不可用";
                    this.Label1.Text = "不可用";
                    this.SSTDownList.Items.Add(new ListItem("无", ""));
                    this.Image1.Visible = false;
                }
            }
        }
    }
Beispiel #10
0
    //初始化
    private void GetInit()
    {
        M_UserInfo   mu       = buser.GetLogin();
        M_CommonData storeMod = conBll.SelMyStore(mu.UserName);

        if (storeMod == null)
        {
            Response.Redirect("StoreApply.aspx");//申请店铺
        }
        if (storeMod != null)
        {
            StoreUrl_L.Text = "<a href='/Store/StoreIndex.aspx?id=" + storeMod.GeneralID + "' target='_blank'> [浏览店铺]</a>";
        }
        gid = storeMod.GeneralID;
        if (storeMod.Status != 99)
        {
            Response.Redirect("StoreEdit.aspx");
        }
        else
        {
            DataTable st = Sql.Sel(storeMod.TableName, "ID=" + storeMod.ItemID, "");
            if (st.Rows.Count != 0)
            {
                Nametxt.Text = st.Rows[0]["StoreName"].ToString();
            }
            else
            {
                Nametxt.Text = "";
            }
            DataTable modeinfo = mfbll.SelectTableName("ZL_Model", "TableName='" + storeMod.TableName + "'");
            if (modeinfo.Rows.Count > 0)
            {
                DataTable cmdinfo = conBll.GetContent(gid);
                if (cmdinfo.Rows.Count > 0)
                {
                    Label3.Text = cmdinfo.Rows[0]["StoreCredit"].ToString();
                    Label4.Text = GetState(cmdinfo.Rows[0]["StoreCommendState"].ToString());
                    M_ModelInfo mi = bmll.GetModelById(int.Parse(cmdinfo.Rows[0]["StoreModelID"].ToString()));
                    Label1.Text = mi.ModelName;
                    DataTable slist = sstbll.GetStyleByModel(int.Parse(cmdinfo.Rows[0]["StoreModelID"].ToString()), 1);
                    HiddenField1.Value         = cmdinfo.Rows[0]["StoreModelID"].ToString();
                    SSTDownList.DataSource     = slist;
                    SSTDownList.DataTextField  = "StyleName";
                    SSTDownList.DataValueField = "ID";
                    SSTDownList.DataBind();
                    SSTDownList.SelectedValue = cmdinfo.Rows[0]["StoreStyleID"].ToString();
                    M_StoreStyleTable sst = sstbll.GetStyleByID(int.Parse(cmdinfo.Rows[0]["StoreStyleID"].ToString()));
                    Image1.ImageUrl = function.GetImgUrl(sst.StylePic);
                    if (cmdinfo.Rows.Count > 0)
                    {
                        ModelHtml.Text = mfbll.InputallHtml(DataConvert.CLng(cmdinfo.Rows[0]["StoreModelID"]), 0, new ModelConfig()
                        {
                            ValueDT = cmdinfo
                        });
                    }
                    else
                    {
                        ModelHtml.Text = mfbll.InputallHtml(DataConvert.CLng(cmdinfo.Rows[0]["StoreModelID"]), 0, new ModelConfig()
                        {
                            Source = ModelConfig.SType.UserBase
                        });
                    }
                }
            }
            else
            {
                conBll.DelContent(gid);
                Response.Redirect("Default.aspx");
                Label3.Text = "不可用";
                Label4.Text = "不可用";
                Label1.Text = "不可用";
                SSTDownList.Items.Add(new ListItem("无", ""));
                Image1.Visible = false;
            }
        }
    }