public ContentResult userLogin(string userName, string userPwd) { APIclass.serviceAPI api = new APIclass.serviceAPI(); string sql = "select sysid from userinfo where username='******' and userpwd='" + userPwd + "'"; int loginResult = api.getRow(sql); if (loginResult > 0) { ContentResult content = new ContentResult(); Session["userLogin"] = userName; //fanhuijieghuo //return RedirectToAction(Session["a"].ToString(), Session["m"].ToString()); if (Session["m"] != null && Session["a"] != null) { string url = "<script language='javaScript' type='text/javaScript'>window.parent.window.location.href ='/" + Session["m"].ToString() + "/" + Session["a"].ToString() + "';</script>"; content.Content = string.Format(url); } else { //return RedirectToAction("Index", "Home"); content.Content = string.Format("<script language='javaScript' type='text/javaScript'>window.parent.window.location.href = '/Home/Index';</script>"); } return(content); } else { Session["userLogin"] = null; //return RedirectToAction("Login", "Login", new { goTo = "loginError" }); ContentResult content = new ContentResult(); content.Content = string.Format("<script language='javaScript' type='text/javaScript'>window.location.href = '/Login/Login?goTo=loginError';</script>"); return(content); } }
public ContentResult userLogin(string userName,string userPwd) { APIclass.serviceAPI api = new APIclass.serviceAPI(); string sql = "select sysid from userinfo where username='******' and userpwd='" + userPwd + "'"; int loginResult=api.getRow(sql); if (loginResult>0) { ContentResult content = new ContentResult(); Session["userLogin"] = userName; //fanhuijieghuo //return RedirectToAction(Session["a"].ToString(), Session["m"].ToString()); if (Session["m"] != null && Session["a"]!=null) { string url = "<script language='javaScript' type='text/javaScript'>window.parent.window.location.href ='/" + Session["m"].ToString() + "/" + Session["a"].ToString() + "';</script>"; content.Content = string.Format(url); } else { //return RedirectToAction("Index", "Home"); content.Content = string.Format("<script language='javaScript' type='text/javaScript'>window.parent.window.location.href = '/Home/Index';</script>"); } return content; } else { Session["userLogin"] = null; //return RedirectToAction("Login", "Login", new { goTo = "loginError" }); ContentResult content = new ContentResult(); content.Content = string.Format("<script language='javaScript' type='text/javaScript'>window.location.href = '/Login/Login?goTo=loginError';</script>"); return content; } }
public void ProcessRequest(HttpContext context) { string sql = "select sysid from userinfo where username='******'";//sql语句 APIclass.serviceAPI sapi = new APIclass.serviceAPI(); int val = sapi.getRow(sql); if (val > 0) { context.Response.Write("N"); } else { context.Response.Write("Y"); } }
public void ProcessRequest(HttpContext context) { if (context.Session["userLogin"] == null) { context.Response.Write("您的会话已经失效,请重新登陆"); } else { string sql = "delete from buycar where sysid='" + context.Request["sysID"] + "'and buyUser='******'";//sql语句 APIclass.serviceAPI sapi = new APIclass.serviceAPI(); int val = sapi.dataProcessor(sql); if (val > 0) { context.Response.Write("从购物车移除成功"); } else { context.Response.Write("从购物车移除失败"); } } }
public void ProcessRequest(HttpContext context) { if (context.Session["userLogin"] == null) { context.Response.Write("您的会话已经失效,请重新登陆"); } else { APIclass.serviceAPI sapi = new APIclass.serviceAPI(); string sql = "update orderInfo set orderstate='已取消' where orderId='" + context.Request["orderId"] + "'and buyUser='******'and orderState='等待系统处理'"; int num = sapi.dataProcessor(sql); if (num < 1) { context.Response.Write("取消失败,可能原因为订单已经开始生产,请联系客服取消"); } else { context.Response.Write("取消成功"); } } }
public void ProcessRequest(HttpContext context) { if (context.Session["userLogin"] == null) { context.Response.Write("您的会话已经失效,请重新登陆"); } else { APIclass.serviceAPI sapi = new APIclass.serviceAPI(); string selectInfo = "select * from bookInfo where bookid=and buyUser='******'"; int num = sapi.getRow(selectInfo); if (num < 1) { string sql = "update buycar set buyNum='" + context.Request["newNum"] + "'where sysid='" + context.Request["sysID"] + "'and buyUser='******'";//sql语句 sapi.dataProcessor(sql); } else { string sql = "update buycar set buyNum='" + context.Request["newNum"] + "'where sysid='" + context.Request["sysID"] + "'and buyUser='******'and booksid !='8'";//sql语句 sapi.dataProcessor(sql); } } }