Esempio n. 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        IDAL.IAuthor ia = BllFactory.BllAccess.CreateIAuthorBLL();

        string userID = Request["ids"].ToString();

        userID = userID.Remove(userID.Length - 1, 1); //移掉最后一个逗号

        string[] uidstring = userID.Split(',');
        int[]    UserSID   = new int[uidstring.Length];

        for (int i = 0; i < UserSID.Length; i++)
        {
            UserSID[i] = Convert.ToInt32(uidstring[i]);
        }

        int count = ia.AuthorCheckYes(UserSID);

        if (count > 0)
        {
            Response.Write("{success:true,msg:'操作成功'}");
        }
        else
        {
            Response.Write("{success:false,msg:'操作失败'}");
        }
    }
Esempio n. 2
0
    protected void Unnamed1_Click(object sender, EventArgs e)
    {
        IDAL.IAuthor ia = BllFactory.BllAccess.CreateIAuthorBLL();

        //添加
        //int count = ia.EidtVolume(TextBox1.Text);
    }
Esempio n. 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        IDAL.IAuthor ia          = BllFactory.BllAccess.CreateIAuthorBLL();
        int          recordCount = 0;
        int          pageindex   = Convert.ToInt32(Request["start"]);
        int          pagesize    = Convert.ToInt32(Request["limit"]);

        if (pagesize == 0)
        {
            pagesize = 22;
        }

        int pageNumber = pageindex / pagesize + 1;

        List <Model.UsersInfo> checkAuthorList = ia.getCheckAuthor(pageNumber, pagesize, out recordCount);

        StringBuilder sb = new StringBuilder("{recordCount:" + recordCount + ",result:[");

        foreach (Model.UsersInfo item in checkAuthorList)
        {
            sb.Append("{UserId:")
            .Append(item.UserId)
            .Append(",UserName:'******',UserType:'")
            .Append(item.UserTypeName)
            .Append("',UserAddress:'")
            .Append(item.userAddress)
            .Append("',IdentityCardNumber:'")
            .Append(item.IdentityCardNumber)
            .Append("',UserSex:'");

            if (item.UserSex == 1)
            {
                sb.Append("男'");
            }
            else
            {
                sb.Append("女'");
            }

            sb.Append("},");
        }

        sb.Remove(sb.Length - 1, 1);
        sb.Append("]}");

        Response.Write(sb.ToString());
    }
Esempio n. 4
0
    protected void Unnamed1_Click(object sender, ImageClickEventArgs e)
    {
        IDAL.IAuthor ia     = BllFactory.BllAccess.CreateIAuthorBLL();
        int          userId = Convert.ToInt32(HttpContext.Current.User.Identity.Name);

        Model.BooksInfo item = new Model.BooksInfo();
        item.BookName         = TextBox1.Text;
        item.AuthorId         = userId;
        item.BookIntroduction = fckAddbooks.Value;
        item.BookType         = (dBookType.SelectedIndex) + 1;
        string fileName = "";

        if (f1.HasFile)
        {
            switch (System.IO.Path.GetExtension(f1.FileName).ToLower())
            {
            case ".jpg": fileName = Guid.NewGuid().ToString() + System.IO.Path.GetExtension(f1.FileName);
                f1.SaveAs(Server.MapPath("~/Images/Books/" + fileName));
                break;

            case ".gif": fileName = Guid.NewGuid().ToString() + System.IO.Path.GetExtension(f1.FileName);
                f1.SaveAs(Server.MapPath("~/Images/Books/" + fileName));
                break;

            default:
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "error", "<script type='text/javascript'>alert('不支持此格式,请使用图片文件');</script>", false);
                break;
            }
            item.Images = fileName;
        }


        if (fileName == "")
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "error", "<script type='text/javascript'>alert('请选择书本封面');</script>", false);
            return;
        }

        int count = ia.AuaddBook(item);

        if (count > 0)
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ok", "<script type='text/javascript'>alert('添加成功!');</script>", false);
        }
        else
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ok", "<script type='text/javascript'>alert('添加失败!');</script>", false);
        }
    }
Esempio n. 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int SeciontId = Convert.ToInt32(Request.QueryString["sectionsId"]);

        IDAL.IAuthor ia    = BllFactory.BllAccess.CreateIAuthorBLL();
        int          count = ia.SectionCheckNo(SeciontId);

        if (count > 0)
        {
            Response.Write("{success:true,msg:'删除成功!'}");
        }
        else
        {
            Response.Write("{success:false,msg:'操作失败'}");
        }
    }
Esempio n. 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int bookid = Convert.ToInt32(Request["bookid"]);

        IDAL.IAuthor ia    = BllFactory.BllAccess.CreateIAuthorBLL();
        int          count = ia.delbook(bookid);

        if (count > 0)
        {
            Response.Write("{success:true,msg:'删除成功'}");
        }
        else
        {
            Response.Write("{success:false,msg:'删除失败'}");
        }
    }
Esempio n. 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        IDAL.IAuthor IA     = BllFactory.BllAccess.CreateIAuthorBLL();
        int          userId = -1;

        Control c = null;

        userId = Convert.ToInt32(HttpContext.Current.User.Identity.Name);

        if (Request.QueryString["ct"] == null)
        {
            c = this.LoadControl(@"~/BookControls/noselect.ascx");
            divedit.Controls.Add(c);
        }
        else
        {
            int ct = Convert.ToInt32(Request.QueryString["ct"]);
            switch (ct)
            {
            case 1:
                c = this.LoadControl(@"~/BookControls/bookface.ascx");
                divedit.Controls.Add(c);
                break;

            case 2:
                c = this.LoadControl(@"~/BookControls/bookvolume.ascx");
                divedit.Controls.Add(c);
                break;

            case 3:
                c = this.LoadControl(@"~/BookControls/booksections.ascx");
                divedit.Controls.Add(c);
                break;

            default:
                c = this.LoadControl(@"~/BookControls/noselect.ascx");
                divedit.Controls.Add(c);
                break;
            }
        }

        repbooks.DataSource = IA.getAuthorBooks(userId);
        repbooks.DataBind();
    }
Esempio n. 8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        IDAL.IAuthor ia          = BllFactory.BllAccess.CreateIAuthorBLL();
        int          recordCount = 0;
        int          pageindex   = Convert.ToInt32(Request["start"]);
        int          pagesize    = Convert.ToInt32(Request["limit"]);

        if (pagesize == 0)
        {
            pagesize = 22;
        }

        int pageNumber = pageindex / pagesize + 1;
        List <Model.SectionsInfo> list = ia.getCheckSections(pageNumber, pagesize, out recordCount);
        StringBuilder             sb   = new StringBuilder("{recordCount:" + recordCount + ",result:[");

        foreach (Model.SectionsInfo item in list)
        {
            sb.Append("{SectiuonId:")
            .Append(Convert.ToInt32(item.SectiuonId))
            .Append(",BookName:'")
            .Append(item.BookName)
            .Append("',CharNum:")
            .Append(Convert.ToInt32(item.CharNum))
            .Append(",ShortAddTime:'")
            .Append(item.ShortAddTime)
            .Append("',StateName:'")
            .Append(item.StateName)
            .Append("',BookId:'")
            .Append(item.BookId)
            .Append("',SectionTitle:'")
            .Append(item.SectionTitle)
            .Append("'},");
        }

        sb.Remove(sb.Length - 1, 1);
        sb.Append("]}");

        Response.Write(sb.ToString());
    }
Esempio n. 9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int    bookid    = Convert.ToInt32(Request.QueryString["BookId"]);
        int    sectionId = Convert.ToInt32(Request.QueryString["sectionId"]);
        string BookNmae  = Request.QueryString["BookName"].ToString();


        IDAL.INovel     novel = BllFactory.BllAccess.CreateINovelBLL();
        Model.BooksInfo item  = novel.getBookCoverInfo(bookid);


        IDAL.IAuthor ia = BllFactory.BllAccess.CreateIAuthorBLL();

        int count = ia.SectionCheckYES(sectionId, bookid, item.BookName);

        if (count > 0)
        {
            Response.Write("{success:true,msg:'操作成功'}");
        }
        else
        {
            Response.Write("{success:false,msg:'操作失败'}");
        }
    }
Esempio n. 10
0
 //删除一本小说
 public int delbook(int bookid)
 {
     IDAL.IAuthor ia = DalFactory.DateAccess.CreateIAuthor();
     return(ia.delbook(bookid));
 }