protected void Page_Load(object sender, EventArgs e) { try { UsertaskManager UM = new UsertaskManager(); UserTaskTBx UT = new UserTaskTBx(); UT.status = 1; UT.task_id = Convert.ToInt32(Request["taskname"]); UT.user_id = Convert.ToInt32(Request["username"]); UM.Add(UT); Response.Write(JsonConvert.SerializeObject(new { success = 1 })); } catch (Exception ex) { Response.Write(JsonConvert.SerializeObject(new { success = -1, error = ex })); } }
protected void Page_Load(object sender, EventArgs e) { UsertaskManager UM = new UsertaskManager(); usertask = UM.GetByID(Convert.ToInt32(Request.QueryString["id"])); TaskManager TM = new TaskManager(); UserManager UrM = new UserManager(); listtask = TM.GetList(); listuser = UrM.GetList(); }
protected void Page_Load(object sender, EventArgs e) { try { UsertaskManager UM = new UsertaskManager(); UserTaskTBx user = new UserTaskTBx(); int id = Convert.ToInt32(Convert.ToInt32(Request["id"])); user = UM.GetByID(id); user.status = -1; UM.Save(); Response.Write(JsonConvert.SerializeObject(new { success = 1 })); } catch (Exception ex) { Response.Write(JsonConvert.SerializeObject(new { success = -1, error = ex })); } }
public void Add(UserTaskTBx user) { DB.UserTaskTBxes.InsertOnSubmit(user); DB.SubmitChanges(); }