public HttpResponseMessage Get(string id) { var author = authormanager.GetByID(id); var result = modelfactory.Create(author); return(Request.CreateResponse(HttpStatusCode.OK, result)); }
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(); }
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(); }
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); }