public int Delete(PHA_Repository obj) { using (Conn) { string query = @"DELETE FROM PHA_Repository WHERE RepoID = @RepoID"; return(Conn.Execute(query, obj)); } }
public int Insert(PHA_Repository obj) { using (Conn) { string query = @"INSERT INTO PHA_Repository VALUES(@RepoID,@RepoName,@PhaNum,@IsValid)"; return(Conn.Execute(query, obj)); } }
public int Update(PHA_Repository obj) { using (Conn) { string query = @"UPDATE PHA_Repository SET RepoName=@RepoName,PhaNum=@PhaNum,IsValid=@IsValid WHERE RepoID =@RepoID"; return(Conn.Execute(query, obj)); } }
public ActionResult AcceptClick(PHA_Repository obj) { string key = Request["key"]; int isOk = default(int); //key表示是否编辑的标识,1表示处于编辑状态 0表示增加状态 if (key == "1") { isOk = ipha_repositorybll.Update(obj); } else { PHA_Repository temp = ipha_repositorybll.GetEntity(obj.RepoID); if (temp == null) { isOk = ipha_repositorybll.Insert(obj); } else { isOk = -1; } } return(Content(isOk.ToString())); }
public int Delete(PHA_Repository obj) { return(dal.Delete(obj)); }
public int Insert(PHA_Repository obj) { return(dal.Insert(obj)); }
public int Update(PHA_Repository obj) { return(dal.Update(obj)); }