public void loginVerification(string para) { try { string mlsCode = joPara["mlsCode"].ToString(); string userCode = joPara["userCode"].ToString(); string pwd = joPara["pwd"].ToString(); BLL.MlsUserBLL objBll = new MlsUserBLL(); IList <Model.MlsUserModel> list = objBll.GetLoginUser(mlsCode, userCode, pwd); if (list == null || list.Count < 1) { ReturnData(0, "失败", null); } else { BLL.MlsDataBLL dataBll = new MlsDataBLL(); IList <Model.MlsDataModel> dataList = dataBll.GetDataByCode("{'userCode':'" + userCode + "'}"); ReturnData(1, "成功", list[0]); } } catch (Exception ex) { ErrorUtil.RecordErrorToFile(ex, joPara, Context); ReturnData(0, ex.Message, ""); } finally { Context.Response.End(); } }
public void getUserLastMlsData(string para) { try { string userCode = joPara["userCode"].ToString(); BLL.MlsDataBLL dataBll = new MlsDataBLL(); IList <Model.MlsDataModel> dataList = dataBll.GetDataByCode("{'userCode':'" + userCode + "'}"); if (dataList == null)//检索失败 { ReturnData(0, "失败", null); } else if (dataList.Count < 1) {//无数据 ReturnData(0, "null", null); } else { ReturnData(1, "成功", dataList[0]); } } catch (Exception ex) { ErrorUtil.RecordErrorToFile(ex, joPara, Context); ReturnData(0, ex.Message, ""); } finally { Context.Response.End(); } }
public void saveMlsData(string para) { BLL.MlsDataBLL dataBll = new MlsDataBLL(); IList <Model.MlsDataModel> dataList = dataBll.GetDataByCode("{'userCode':'" + joPara["userCode"].ToString() + "'}"); MlsDataModel mlsData; if (dataList.Count > 0)//更新数据库 { mlsData = dataList[0]; } else//创建记录 { mlsData = new MlsDataModel(); mlsData.UserCode = joPara["userCode"].ToString(); mlsData.MlsCode = joPara["mlsCode"].ToString(); mlsData.ClientCode = joPara["clientCode"].ToString(); } string mlsDataStr = joPara["MlsData"].ToString(); var mlsDataArray = mlsDataStr.Split('|'); mlsData.X = double.Parse(mlsDataArray[0].Split(',')[0]); mlsData.Y = double.Parse(mlsDataArray[0].Split(',')[1]); mlsData.Xl = int.Parse(mlsDataArray[1]); mlsData.Sd = float.Parse(mlsDataArray[2]); mlsData.Bs = int.Parse(mlsDataArray[3]); mlsData.Bp = int.Parse(mlsDataArray[4]); mlsData.Tw = float.Parse(mlsDataArray[5]); mlsData.Ps = int.Parse(mlsDataArray[6]); mlsData.Bf = int.Parse(mlsDataArray[7]); mlsData.Distance = decimal.Parse(mlsDataArray[8]); mlsData.GetTime = DateTime.Now; if (mlsData.Id == null || mlsData.Id == "")//创建 { if (dataBll.Add(mlsData) != null) { ReturnData(1, "成功", null); } else { ReturnData(0, "失败", null); } } else { if (dataBll.Update(mlsData))//更新成功 { ReturnData(1, "成功", null); } else { ReturnData(0, "失败", null); } } }
public void getStatistics(string para) { BLL.MlsDataBLL dataBll = new MlsDataBLL(); int group = int.Parse(joPara["group"].ToString());//分组大小 var dataList = dataBll.getStatistics(group); if (dataList != null) { ReturnData(1, "成功", dataList); } else { ReturnData(0, "失败", null); } }
public void getPoints(string para) { BLL.MlsDataBLL dataBll = new MlsDataBLL(); IList <Model.MlsDataModel> dataList = dataBll.GetDataByCode("{'order':' user_Code asc '}"); //[24.4937309384,118.1267599777] List <double[]> points = new List <double[]>(); double[] point = new double[2]; foreach (MlsDataModel model in dataList) { point[0] = (double)model.X; point[1] = (double)model.Y; points.Add(point); point = new double[2]; } ReturnData(1, "成功", points); }