//public string GetCheckInDT(int checkinid) //{ // List<CheckInDT> ciDT = CheckInDTDb.GetList(c => // c.delflag == false & c.CheckInID == checkinid).OrderBy(k => k.CheckData).ToList(); // return DataSwitch.HttpPostList<CheckInDT>(ciDT); //} public string GetCheckInMTDT(int checkinmtid) { CheckInMT mT = checkInMTSer.GetCheckInMTByid(checkinmtid); List <CheckInDT> dtlist = checkInDTSer.GetCheckInDTs(checkinmtid); return(DataSwitch.HttpPostData <CheckInDT, CheckInMT>(dtlist, mT)); }
public void populateList(string result) { Dictionary <string, List <string> > dictionary = FormatFunctions.createValuePairs(FormatFunctions.SplitToPairs(result)); for (int i = 0; i < dictionary["FName"].Count; i++) { string text = dictionary["FName"][i] ?? ""; Label item = new Label { Content = (text ?? ""), }; DataSwitch item2 = new DataSwitch(int.Parse(dictionary["IDKey"][i])) { }; DataSwitch item3 = new DataSwitch(int.Parse(dictionary["IDKey"][i])) { }; List <UIElement> list = new List <UIElement>() { item, item2, item3 }; GridFiller.rapidFillPremadeObjects(list, TSection, new bool[] { true, true, true }); Favorites.Add(item2); Group.Add(item3); } }
//弃用,流式数据不能生成对应文件(包含上传参数) public string UpLoadStreamFile(Stream sr, string uploadpath, string filename) { try { int size = 1024; byte[] by = new byte[size]; int length = sr.Read(by, 0, size); if (!Directory.Exists(uploadpath)) { Directory.CreateDirectory(uploadpath); } FileStream fs = new FileStream(uploadpath + "//" + filename, FileMode.Create, FileAccess.Write); while (length > 0) { fs.Write(by, 0, by.Length); length = sr.Read(by, 0, size); } fs.Close(); sr.Close(); } catch (Exception e) { return(DataSwitch.HttpPostMsg(e.Message, 0)); } return(DataSwitch.HttpPostMsg("上传成功", 1)); }
public string GetNextNumber() { var q = dbSet.GetById(1); DateTime qrday = q.QRday.StrToDateTime(); DateTime nday = DateTime.Now.Date; int num = nday.CompareTo(qrday); if (num != 0) { q.QRday = nday.ToShortDateString(); q.QROrder = 1; } else { q.QROrder++; } bool count = dbSet.Update(q); int upd = count ? (int)q.QROrder : 0; string qrnum = nday.ToString("yyyyMMdd") + upd.ToString().PadLeft(3, '0'); qrnum = "CS" + qrnum.Substring(2); return(DataSwitch.HttpPostMsg(qrnum)); }
public bool UpdateCheckInMT(CheckInMT mT) { string url = KNDBsysUrl.WorkUrl.CheckInBLL.UpdateCheckInMT; HttpTools tools = new HttpTools(); tools.AddParam("checkinmt", DataSwitch.DataToJson(mT)).Build();; return(GetMsg(url, tools).ToInt() > 0); }
public int UpdateCheckInDT(CheckInDT dT) { string url = KNDBsysUrl.WorkUrl.CheckInBLL.UpdateCheckInDT; HttpTools tools = new HttpTools(); tools.AddParam("checkindt", DataSwitch.DataToJson(dT)).Build();; return(GetMsg(url, tools).ToInt()); }
public List <DsHistory> GetHisbyID(string sid) { string sql = string.Format("SELECT * FROM DShist WHERE stuid = '{0}'", sid); DataTable dt = initsql.SQLiteGetTable(sql); List <DsHistory> hislist = DataSwitch.DTToList <DsHistory>(dt); return(hislist); }
public DSstu GetStuByID(string sid) { string sql = string.Format("SELECT * FROM DSstudent WHERE IDcard = '{0}'", sid); DataTable dt = initsql.SQLiteGetTable(sql); DSstu ds = DataSwitch.DTToObject <DSstu>(dt); return(ds); }
public string GetAllUser() { UserInfoService infoService = new UserInfoService(); List <UserInfo> users = infoService.GetAllUserinfo(1); string str = DataSwitch.DataToJson(users); return(str); }
public void UpdateAllStuData() { Posts p = hc.GetAllStu(); DsPostVerid dpv = hc.GetSerStuVer(); List<DSstu> dslist = DataSwitch.JsonToList<DSstu>(p.Jsons); dop.InsandDelStuData(dslist); dop.UpdataVer(dpv,0); }
public bool DeleteAuthority(Authority auth) { string url = KNDBsysUrl.BaseInfoUrl.AuthorityUrl.DeleteAuthority; HttpTools tools = new HttpTools(); tools.AddParam("authority", DataSwitch.DataToJson(auth)).Build(); string msg = GetMsg(url, tools); return(msg.ToInt() > 0); }
public bool Deleteuserinfo(UserInfo userInfo) { string url = KNDBsysUrl.BaseInfoUrl.UserInfoUrl.DeleteUserInfo; HttpTools t = new HttpTools(); t.AddParam("userinfo", DataSwitch.DataToJson(userInfo)).Build(); string msg = GetMsg(url, t); return(msg.ToInt() > 0); }
public bool DeleteServerType(ServerType serverType) { string url = KNDBsysUrl.BaseInfoUrl.ServerTypeUrl.DeleteServerType; HttpTools tools = new HttpTools(); tools.AddParam("servertype", DataSwitch.DataToJson(serverType)).Build(); string msg = GetMsg(url, tools); return(msg.ToInt() > 0); }
public string GetAllUserInfo(string userid) { var userlist = dbSet.FullClient.Queryable <RegUserInfo>().Where(e => e.delflag == false).Select((ui) => new RegUserInfo() { id = ui.id, RegName = ui.RegName, RegTel = ui.RegTel }).ToList(); return(DataSwitch.HttpPostList <RegUserInfo>(userlist)); }
public bool DeleteCustomInfo(CustomInfo customInfo) { string url = KNDBsysUrl.BaseInfoUrl.CustomInfoUrl.DeleteCustomInfo; HttpTools tools = new HttpTools(); tools.AddParam("customInfo", DataSwitch.DataToJson(customInfo)).Build(); string msg = GetMsg(url, tools); return(msg.ToInt() > 0); }
public bool DeleteUserAuth(List <UserAuth> userAuths, string userid) { string url = KNDBsysUrl.BaseInfoUrl.UserAuthUrl.DelteUserAuth; HttpTools tools = new HttpTools(); tools.AddParam("userauthjson", DataSwitch.DataToJson(userAuths)) .AddParam("userid", userid).Build(); string msg = GetMsg(url, tools); return(msg.ToInt() > 0); }
//public string GetCheckInMT(int customid,int stauts) //{ // List<CheckInMT> ciMT = CheckInMTDb.GetList( c => // c.delflag == false & c.CustomID == customid ).ToList(); // if (stauts == 0) // { // ciMT = ciMT.Where(e => e.ServerStauts == stauts).ToList(); // } // return DataSwitch.HttpPostList<CheckInMT>(ciMT); //} public string GetCustomidByQR(string qrcode) { CheckInMT mT = checkInMTSer.GetCheckInMTByQR(qrcode); string customid = General.strFail; if (mT.id != 0) { customid = mT.CustomID.ToString(); } return(DataSwitch.HttpPostMsg(customid)); }
public List <Authority> AddUserAuth(List <Authority> userAuths, string userid) { string url = KNDBsysUrl.BaseInfoUrl.UserAuthUrl.AddUserAuth; HttpTools tools = new HttpTools(); tools.AddParam("auth", DataSwitch.DataToJson(userAuths)) .AddParam("userid", userid).Build(); List <Authority> add = GetList(url, tools); return(add); }
/// <summary> /// 删除数据 /// </summary> /// <param name="json">实体类json</param> /// <returns>postdata msg 1,0</returns> public string DeleteEntity(string json) { T entity = DataSwitch.JsonToObj <T>(json); if (entity == null) { return(General.strFail); } bool count = dbSet.Delete(entity); return(DataSwitch.HttpPostMsg(count ? General.strSucess : General.strFail)); }
/// <summary> /// 增加数据 /// </summary> /// <param name="json">实体类json</param> /// <returns>Postdata msg id</returns> public string AddEntity(string json) { T entity = DataSwitch.JsonToObj <T>(json); if (entity == null) { return(General.strFail); } int count = dbSet.InsertReturnIdentity(entity); return(DataSwitch.HttpPostMsg(count)); }
public string UpdateDictionary(string dic) { Sysdic csDic = DataSwitch.JsonToObj <Sysdic>(dic); if (cSDic == null) { return(General.strFail); } bool count = cSDic.Update(csDic); return(DataSwitch.HttpPostMsg(count ? General.strSucess:General.strFail)); }
public string GetNewSysVer(string programtype) { int count = dbSet.GetList(v => v.programtype == programtype).Count; if (count > 0) { var q = dbSet.GetList().OrderByDescending(v => v.id).First().id; var sysver = dbSet.GetById(q); return(DataSwitch.HttpPostEntity <SysVer>(sysver)); } return(DataSwitch.HttpPostMsg(General.strFail, General.intFail)); }
public string DeleteSysdic(string dic) { Sysdic sysDic = DataSwitch.JsonToObj <Sysdic>(dic); if (sysDic == null) { return(General.strFail); } bool count = cSDic.Del(sysDic); return(DataSwitch.HttpPostMsg(count ? General.strSucess : General.strFail)); }
public string CopyAuth(string userid, string copyuserid) { var userauth = dbSet.GetList(u => u.UserID == userid.ToInt()); foreach (var u in userauth) { u.UserID = copyuserid.ToInt(); } bool check = dbSet.InsertRange(userauth.ToArray()); string str = check ? General.strSucess : General.strFail; return(DataSwitch.HttpPostMsg(str)); }
public void UpdataDiffStuData() { DsPostVerid ldpv = dop.GetLocalDPV("0"); DsPostVerid sdpv = hc.GetSerStuVer(); List<Posts> plist = hc.StuDiff(sdpv, ldpv); List<DSstu> dslist = new List<DSstu>(); foreach (var p in plist) { List<DSstu> dl = DataSwitch.JsonToList<DSstu>(p.Jsons); dslist.AddRange(dl); } dop.InsandDelStuData(dslist); dop.UpdataVer(sdpv,0); }
public void UpdataHisData() { DsPostVerid ldpv = dop.GetLocalDPV("1"); DsPostVerid sdpv = hc.GetSerHisVer(); List<Posts> plist = hc.HisData(sdpv, ldpv); List<DsHistory> dshlist = new List<DsHistory>(); foreach (var p in plist) { List<DsHistory> dl = DataSwitch.JsonToList<DsHistory>(p.Jsons); if (dl == null) continue; dshlist.AddRange(dl); } dop.InsertHisData(dshlist); dop.UpdataVer(sdpv, 1); }
public string GetUserInfo(string name, string post) { string url = KNDBsysUrl.BaseInfoUrl.UserInfoUrl.GetAllUserInfo; HttpTools tools = new HttpTools(); tools.AddParam("name", name).AddParam("post", post).Build(); HttpWebResponse res = HttpHelper.CreatePostHttpResponse(url, tools.dic, 3000, null); if (res != null) { return(DataSwitch.GetResponseString(res)); } return(""); }
public List <Sysdic> GetDicByType(string type) { string url = KNDBsysUrl.BaseInfoUrl.DictionaryUrl.GetDicByType; HttpTools tools = new HttpTools(); tools.AddParam("dictype", type).Build(); HttpWebResponse res = HttpHelper.CreatePostHttpResponse(url, tools.dic, 3000, null); if (res != null) { string json = DataSwitch.GetResponseString(res); PostData <Sysdic, DBNull> postData = DataSwitch.JsonToObj <PostData <Sysdic, DBNull> >(json); return(postData.rows); } return(new List <Sysdic>()); }
public string AddDictionary(string dic) { Sysdic csDic = DataSwitch.JsonToObj <Sysdic>(dic); if (cSDic == null) { return(General.strFail); } int count = cSDic.Add(csDic).id; if (count > 0) { return(DataSwitch.HttpPostMsg(count)); } return(DataSwitch.HttpPostMsg(General.strFail)); }
public string DeleteAuth(string userauthjson, string userid) { List <UserAuth> authlist = DataSwitch.JsonToList <UserAuth>(userauthjson); var user = dbSet.GetList(u => u.UserID == userid.ToInt()); foreach (var dbauth in user) { foreach (var auth in authlist) { if (auth.AuthID == dbauth.AuthID) { dbSet.Delete(dbauth); } } } return(DataSwitch.HttpPostMsg(General.strSucess)); }