public static bool Insert(Model.bk bk) { if (Dal.bk.Exists(bk)) { return(false); } return(Dal.bk.Insert(bk)); }
public static bool Insert(Model.bk m) { Gx.Sql sql = new Gx.Sql("(uid,sqly,name,zw,dw,jsxq,time,type) values(@uid,@sqly,@name,@zw,@dw,@jsxq,@time,@type)", "bk", "", m); if (sql.Insert() > 0) { return(true); } return(false); }
public static bool Delete(Model.bk m) { Gx.Sql sql = new Gx.Sql("", "bk", "where id=@id and uid=@uid", m); if (sql.Delete() > 0) { return(true); } return(false); }
public static bool Update(Model.bk m) { Gx.Sql sql = new Gx.Sql("type=@type", "bk", "where id=@id", m); if (sql.Update() > 0) { return(true); } return(false); }
public IActionResult sq(string reason, string name, string job, string address, string hobby) { string json = HttpContext.Session.GetString("user_login"); if (json == null) { return(Redirect("/home/index")); } Model.user_login u_l = Gx.Json.StrToObj <Model.user_login>(json); Model.Userone u = Bll.Login.Get_User(u_l); if (u == null) { return(Redirect("/home/index")); } /// Gx.AjaxMessage ajax = new Gx.AjaxMessage(); Model.bk b = new Model.bk() { uid = u.id, sqly = reason, name = name, zw = job, dw = address, jsxq = hobby, time = DateTime.Now, type = 0 }; if (Bll.shengpi.Insert(b)) { ajax.result = true; ajax.message = "申请成功请等待审核!"; } else { ajax.result = false; ajax.message = "不能多次申请!"; } /// u_l = Bll.Login.User_Login_Update(u_l); if (u_l != null) { HttpContext.Session.SetString("user_login", Gx.Json.ObjToStr(u_l)); } return(Content(ajax.ToString())); }
public IActionResult sp(int id, int type) { string json = HttpContext.Session.GetString("user_login"); if (json == null) { return(Redirect("/home/index")); } Model.user_login u_l = Gx.Json.StrToObj <Model.user_login>(json); Model.Userone u = Bll.Login.Get_User(u_l); if (u == null) { return(Redirect("/home/index")); } /// Gx.AjaxMessage ajax = new Gx.AjaxMessage(); Model.bk b = new Model.bk() { id = id, type = type }; if (Bll.shengpi.Update(b)) { ajax.result = true; ajax.message = "审批成功!"; } else { ajax.result = false; ajax.message = "审批失败!"; } /// u_l = Bll.Login.User_Login_Update(u_l); if (u_l != null) { HttpContext.Session.SetString("user_login", Gx.Json.ObjToStr(u_l)); } return(Content(ajax.ToString())); }
public static bool Update(Model.bk bk) { return(Dal.bk.Update(bk)); }
public static bool Delete(Model.bk bk) { return(Dal.bk.Delete(bk)); }
public static bool Exists(Model.bk m) { Gx.Sql sql = new Gx.Sql("*", "bk", "where (type=1 or type=0) and uid=@uid", m); return(sql.Exists <Model.bk>()); }