예제 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AuthorTBx     author = new AuthorTBx();
        AuthorManager am     = new AuthorManager();

        author       = am.GetByID(Convert.ToInt32(Request["id"]));
        author.Name  = Request["name"];
        author.Phone = Request["phone"];
        author.Desc  = Request["desc"];
        author.Email = Request["email"];

        string listcat = Request["listcat"];

        Author_CategoryManager    acm = new Author_CategoryManager();
        List <Author_CategoryTBx> listauthorcatnew = new List <Author_CategoryTBx>();

        for (int i = 0; i < listcat.Split('@').Length - 1; i++)
        {
            Author_CategoryTBx authorcat = new Author_CategoryTBx();
            authorcat.CategoryID = Convert.ToInt32(listcat.Split('@')[i]);
            authorcat.AuthorID   = author.ID;
            listauthorcatnew.Add(authorcat);
        }
        List <Author_CategoryTBx> listauthorcat = new List <Author_CategoryTBx>();

        listauthorcat = acm.GetListID(author.ID);
        acm.DeleteCat(listauthorcat);
        acm.AddNew(listauthorcatnew);

        am.Save();
    }
예제 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AuthorManager AM     = new AuthorManager();
        AuthorTBx     author = AM.GetByID(Convert.ToInt32(Request["id"]));

        author.Status = -1;
        AM.Save();
    }
예제 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AuthorManager am = new AuthorManager();

        author = am.GetByID(Convert.ToInt32(Request["id"]));
        CategoryManager cm = new CategoryManager();

        listCategory = cm.GetList();
        Author_CategoryManager acm = new Author_CategoryManager();

        listauthorcat = acm.GetListID(author.ID);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        AuthorTBx     author = new AuthorTBx();
        AuthorManager am     = new AuthorManager();

        author.Name   = Request["name"];
        author.Phone  = Request["phone"];
        author.Desc   = Request["desc"];
        author.Email  = Request["email"];
        author.Status = 1;
        am.AddNew(author);
        string listcat = Request["listcat"];
        List <Author_CategoryTBx> listauthorcat = new List <Author_CategoryTBx>();
        Author_CategoryManager    acm           = new Author_CategoryManager();

        for (int i = 0; i < listcat.Split('@').Length - 1; i++)
        {
            Author_CategoryTBx authorcat = new Author_CategoryTBx();
            authorcat.AuthorID   = author.ID;
            authorcat.CategoryID = Convert.ToInt32(listcat.Split('@')[i]);
            listauthorcat.Add(authorcat);
        }
        acm.AddNew(listauthorcat);
    }
예제 #5
0
 partial void DeleteAuthorTBx(AuthorTBx instance);
예제 #6
0
 partial void UpdateAuthorTBx(AuthorTBx instance);
예제 #7
0
 partial void InsertAuthorTBx(AuthorTBx instance);
예제 #8
0
 public void AddNew(AuthorTBx author)
 {
     db.AuthorTBxes.InsertOnSubmit(author);
     Save();
 }
예제 #9
0
 public void AddNew(AuthorTBx authorcategory)
 {
     DB.AuthorTBxes.InsertOnSubmit(authorcategory);
     DB.SubmitChanges();
 }