public override object GetData() { int i = -1; string id = ""; try { id = (string)optdatas["id"]; } catch { id = ""; } JsonData js = new JsonData(); try { Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add("dm", "1"); BaseDal.UpdateTables("danci_t", dic, "id=" + id + ""); i = 1; } catch (Exception ex) { JngsDal.RecordError("isshoucang", ex.Message); } AddJsonProperty("id", ref js); js["id"] = i; return(js); }
public override object GetData() { int i = 0; string account = ""; try { account = (string)optdatas["account"]; } catch { account = ""; } string pwd = ""; try { pwd = (string)optdatas["pwd"]; } catch { pwd = ""; } string message = ""; string token = ""; try { token = (string)optdatas["token"]; } catch { token = ""; } JsonData js = new JsonData(); try { pwd = "666666"; AddJsonProperty("userinfo", ref js); var dt = tdal.public_user_login(account, BaseDal.MD5Encrype(pwd)); if (dt.Rows.Count > 0) { if (dt.Rows[0]["DeleteMark"].ToString() == "1") { i = -2; message = "此号被冻结"; js["userinfo"] = DataTableToJson(dt); } else { i = 1; message = "成功"; js["userinfo"] = DataTableToJson(dt); } } else { i = -1; message = "账号或密码错误"; js["userinfo"] = DataTableToJson(dt); } } catch (Exception ex) { JngsDal.RecordError("get_code", ex.Message); } AddJsonProperty("id", ref js); AddJsonProperty("message", ref js); js["id"] = i; js["message"] = message; return(js); }
public override object GetData() { int i = 0; string nicheng = ""; try { nicheng = (string)optdatas["nicheng"]; } catch { nicheng = ""; } string shuoming = ""; try { shuoming = (string)optdatas["shuoming"]; } catch { shuoming = ""; } string userid = ""; try { userid = (string)optdatas["userid"]; } catch { userid = ""; } string baseimg = ""; try { baseimg = (string)optdatas["baseimg"]; } catch { baseimg = ""; } JsonData js = new JsonData(); try { Dictionary <string, string> dic = new Dictionary <string, string>(); if (baseimg != "") { string ss = baseimg; byte[] bt = Convert.FromBase64String(ss); System.IO.MemoryStream stream = new System.IO.MemoryStream(bt); Bitmap bitmap = new Bitmap(stream); string filesname = DateTime.Now.ToFileTime() + ".jpg"; bitmap.Save(@"C:\Web\笔记系统\fileimg\" + filesname + "", System.Drawing.Imaging.ImageFormat.Jpeg); dic.Add("picurl", "../fileimg/" + filesname); } dic.Add("UserName", nicheng); dic.Add("jieshao", shuoming); i = 1; BaseDal.UpdateTables("baseuser", dic, "userid='" + userid + "'"); } catch (Exception ex) { JngsDal.RecordError("xiugai_ziliao", ex.Message); } AddJsonProperty("id", ref js); js["id"] = i; return(js); }
public override object GetData() { int i = 0; string account = ""; try { account = (string)optdatas["account"]; } catch { account = ""; } string status = ""; try { status = (string)optdatas["status"]; } catch { status = ""; } JsonData js = new JsonData(); string message = ""; try { string str = ""; if (status == "0") { str = "注册"; } else { str = "重置密码的"; } Random rad = new Random(); //实例化随机数产生器rad; int value_code = rad.Next(1000, 10000); //用rad生成大于等于1000,小于等于999搜索9的随机数; bool s = Tools.sendSMS(account, "1e469859e14047078420cc05a96f19c1", "您的" + str + "验证码是:" + value_code.ToString() + ""); if (s) { tdal.insert_text_code(account, value_code.ToString()); i = 1; message = "成功"; } else { i = -1; message = "失败"; } } catch (Exception ex) { JngsDal.RecordError("get_code", ex.Message); } AddJsonProperty("id", ref js); AddJsonProperty("message", ref js); js["id"] = i; js["message"] = message; return(js); }
public override object GetData() { string page = ""; try { page = (string)optdatas["page"]; } catch { page = ""; } string uid = ""; try { uid = (string)optdatas["uid"]; } catch { uid = ""; } string code = ""; try { code = (string)optdatas["code"]; } catch { code = ""; } string titile = ""; try { titile = (string)optdatas["title"]; } catch { titile = ""; } JsonData js = new JsonData(); DataTable dt = new DataTable(); try { string where = ""; if (titile != "") { where += " and a.title like '%" + titile + "%'"; } switch (code) { case "1": { where += " and a.shoucang=1 "; } break; //收藏的 case "2": { where += " and a.status=1 "; } break; //提醒的 case "3": { where += " and a.dm=1 "; } break; //已删除的 case "4": { where += " and a.dm= 0"; } break; //未删除的 case "5": { where += " and a.status= 2"; } break; //完成的 } where += " and a.userid='" + uid + "' "; dt = tdal.get_mydanci(where, page); js = DataTableToJson(dt); } catch (Exception ex) { JngsDal.RecordError("complain_dispose", ex.Message); } return(js); }
public override object GetData() { int i = 0; string id = ""; try { id = (string)optdatas["id"]; } catch { id = ""; } JsonData js = new JsonData(); try { } catch (Exception ex) { JngsDal.RecordError("shoucang", ex.Message); } AddJsonProperty("id", ref js); js["id"] = i; return(js); }
public override object GetData() { int i = 123456; string page = ""; try { page = (string)optdatas["page"]; } catch { page = ""; } JsonData js = new JsonData(); DataTable dt = new DataTable(); try { js = DataTableToJson(dt); bool s = Tools.sendSMS("13606379420", "", ""); } catch (Exception ex) { JngsDal.RecordError("complain_dispose", ex.Message); } return(js); }
public override object GetData() { int i = -1; string id = ""; try { id = (string)optdatas["id"]; } catch { id = ""; } JsonData js = new JsonData(); try { var dt = tdal.get_mydanci(" and a.id=" + id + "", "1"); if (dt.Rows.Count > 0) { if (dt.Rows[0]["shoucang"].ToString() == "0") { Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add("shoucang", "1"); BaseDal.UpdateTables("danci_t", dic, "id=" + id + ""); i = 1; } else { Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add("shoucang", "0"); BaseDal.UpdateTables("danci_t", dic, "id=" + id + ""); i = 0; } } } catch (Exception ex) { JngsDal.RecordError("isshoucang", ex.Message); } AddJsonProperty("id", ref js); js["id"] = i; return(js); }
public isdm(JsonData dta) : base(dta) { tdal = new JngsDal(); }
public override object GetData() { int i = 0; string account = ""; try { account = (string)optdatas["account"]; } catch { account = ""; } string pwd = ""; try { pwd = (string)optdatas["pwd"]; } catch { pwd = ""; } string textcode = ""; try { textcode = (string)optdatas["textcode"]; } catch { textcode = ""; } JsonData js = new JsonData(); string message = ""; AddJsonProperty("userinfo", ref js); try { pwd = "666666"; var dt = tdal.get_text_code(account); if (dt.Rows.Count > 0) { if (dt.Rows[0]["code"].ToString() == textcode) { var dt_user = tdal.get_baseuser_where(" and UserAccount='" + account + "' "); if (dt_user.Rows.Count <= 0) { Dictionary <string, string> dic = new Dictionary <string, string>(); dic.Add("UserAccount", account); dic.Add("Password", BaseDal.MD5Encrype(pwd)); dic.Add("UserId", DateTime.Now.ToFileTime().ToString()); int useid = BaseDal.InsertToTables("BaseUser", dic); string token = CommonHelper.GetGuid; Dictionary <string, string> dic1 = new Dictionary <string, string>(); dic1.Add("userid", useid.ToString()); dic1.Add("accesstoken", token); BaseDal.InsertToTables("user_accesstoken", dic1); var dt_user2 = tdal.get_baseuser_where(" and UserAccount='" + account + "' "); dt_user2.Columns.Add("token"); dt_user2.Rows[0]["token"] = token; i = 1; message = "登录成功"; js["userinfo"] = DataTableToJson(dt_user2); } else { i = 1; string token = CommonHelper.GetGuid; Dictionary <string, string> dic1 = new Dictionary <string, string>(); dic1.Add("userid", dt_user.Rows[0]["id"].ToString()); dic1.Add("accesstoken", token); BaseDal.InsertToTables("user_accesstoken", dic1); dt_user.Columns.Add("token"); dt_user.Rows[0]["token"] = token; js["userinfo"] = DataTableToJson(dt_user); message = "登录成功"; } } else { i = -2; message = "验证码错误"; } } else { message = "验证码错误"; i = -1; } } catch (Exception ex) { JngsDal.RecordError("register", ex.Message); } AddJsonProperty("id", ref js); AddJsonProperty("message", ref js); js["id"] = i; js["message"] = message; return(js); }
public register(JsonData dta) : base(dta) { tdal = new JngsDal(); }
public test(JsonData dta) : base(dta) { tdal = new JngsDal(); }
public xiugai_ziliao(JsonData dta) : base(dta) { tdal = new JngsDal(); }
public override object GetData() { int i = 0; string titile = ""; try { titile = (string)optdatas["titile"]; } catch { titile = ""; } string content = ""; try { content = (string)optdatas["content"]; } catch { content = ""; } string userid = ""; try { userid = (string)optdatas["userid"]; } catch { userid = ""; } string baseimg = ""; try { baseimg = (string)optdatas["baseimg"]; } catch { baseimg = ""; } JsonData js = new JsonData(); try { Dictionary <string, string> dic = new Dictionary <string, string>(); string filesname = ""; if (baseimg != "") { string ss = baseimg; byte[] bt = Convert.FromBase64String(ss); System.IO.MemoryStream stream = new System.IO.MemoryStream(bt); Bitmap bitmap = new Bitmap(stream); filesname = DateTime.Now.ToFileTime() + ".jpg"; bitmap.Save(@"C:\Web\笔记系统\fileimg\" + filesname + "", System.Drawing.Imaging.ImageFormat.Jpeg); } dic.Add("titile", titile); dic.Add("content", content); dic.Add("userid", userid); i = 1; int ii = BaseDal.InsertToTables("danci_t", dic); if (filesname != "") { Dictionary <string, string> dic2 = new Dictionary <string, string>(); dic2.Add("danciid", ii.ToString()); dic2.Add("picurl", "../fileimg/" + filesname); BaseDal.InsertToTables("upfiles", dic2); } } catch (Exception ex) { JngsDal.RecordError("tijiaobiji", ex.Message); } AddJsonProperty("id", ref js); js["id"] = i; return(js); }
public get_login(JsonData dta) : base(dta) { tdal = new JngsDal(); }
public shoucang(JsonData dta) : base(dta) { tdal = new JngsDal(); }
public istixing(JsonData dta) : base(dta) { tdal = new JngsDal(); }
public get_code(JsonData dta) : base(dta) { tdal = new JngsDal(); }
public iswancheng(JsonData dta) : base(dta) { tdal = new JngsDal(); }
public tijiaobiji(JsonData dta) : base(dta) { tdal = new JngsDal(); }
public get_my_biji(JsonData dta) : base(dta) { tdal = new JngsDal(); }