public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; string phone = context.Request["CheckPhone"]; if (context.Request["buyId"] != null) { int res = AdminMng.CheckBuy(Convert.ToInt32(context.Request["buyId"])); if (res == 0) { context.Response.Write("ok"); } else { context.Response.Write("no"); } return; } if (PersonSvc.RetrieveByPhone(phone).Count != 0) { context.Response.Write("no"); return; } context.Response.Write("ok"); }
/// <summary> /// /// </summary> /// <param name="person"></param> /// <returns>-1: fail; 0: success</returns> public static int Reg(Person person) { if (PersonSvc.RetrieveByPhone(person.Phone).Count > 0) { return(-1); } else { PersonSvc.Create(person); return(0); } }
/// <summary> /// /// </summary> /// <param name="person"></param> /// <returns>-3: >1; -2 <=0; -1 fail; 0:success </returns> public static int Log(ref Person person) { List <Person> list = PersonSvc.RetrieveByPhone(person.Phone); if (list.Count > 1) { return(-3); } else if (list.Count <= 0) { return(-2); } else if (list[0].Psd.Equals(person.Psd) == false) { return(-1); } else { person = list[0]; return(0); } }
public static int QueryPersonByPhone(string phone, ref Person person) { person = PersonSvc.RetrieveByPhone(phone)[0]; return(0); }