//读取我写入的信息 public ActionResult SelectMyData() { int pageIdex = Request["page"] != null?int.Parse(Request["page"]) : 1; int pageSize = Request["rows"] != null?int.Parse(Request["rows"]) : 35; int totalcount = int.MaxValue; var mydata = T_FGJHtmlDataService.LoadPageEntities(pageIdex, pageSize, out totalcount, x => x.AddItemsUserID == LoginUser.ID, x => x.ID, false); var temp = from a in mydata select new { ID = a.ID, HLName = a.HLName, Image_str = (a.Image_str.IndexOf("有") >= 0 ? "有" : "无"), FbTime = a.FbTime, PersonName = a.PersonName, Address = a.Address, photo = a.photo, Laiyuan = a.Laiyuan, FwSumMoney = a.FwSumMoney, FwHuXing = a.FwHuXing, FwLoucheng = a.FwLoucheng, FwZhuangxiu = a.FwZhuangxiu, FwChaoxiang = a.FwChaoxiang, FwNianxian = a.FwNianxian, FwMianji = a.FwMianji }; return(Json(new { rows = temp, total = totalcount }, JsonRequestBehavior.AllowGet)); }
public ActionResult GetHref() { int pageIndex = Request["page"] != null?int.Parse(Request["page"]) : 1; int pageSize = Request["rows"] != null?int.Parse(Request["rows"]) : 15; var totalCount = int.MaxValue; var CityID = UserInfo_CityService.LoadEntities(x => x.UserInfo_ID == LoginUser.ID).FirstOrDefault(); string Str = Request["Str"]; //构建搜索条件 UserInfoParam userInfoParam = new UserInfoParam() { C_id = Convert.ToInt32(LoginUser.ID), PageIndex = pageIndex, PageSize = pageSize, TotalCount = totalCount, Str = Str, Tval = Request["Tval"] }; MyhtmlInfoController.SetInfoParam(userInfoParam, T_ItemsService); //MyhtmlInfoController mhc = new MyhtmlInfoController(); //mhc.SetInfoParam //找到所有该人员信息 var savelist = T_SaveHtmlDataService.LoadPageEntities <DateTime>(pageIndex, pageSize, out totalCount, x => x.UserInfo.MasterID == LoginUser.ID && x.DelFlag == Delflag, x => x.SaveTime, false).DefaultIfEmpty(); var ActionInfoList = T_FGJHtmlDataService.LoadSearchFrist(userInfoParam, false, false); var temp = from a in ActionInfoList from b in savelist where b.HtmldataID == a.ID select new { ID = a.ID, HLName = a.HLName, Image_str = (a.Image_str.IndexOf("有") >= 0 ? "有" : "无"), FbTime = a.FbTime, PersonName = a.PersonName, Address = a.Address, photo = a.photo, Laiyuan = a.Laiyuan, FwSumMoney = a.FwSumMoney, FwHuXing = a.FwHuXing, FwLoucheng = a.FwLoucheng, FwZhuangxiu = a.FwZhuangxiu, FwChaoxiang = a.FwChaoxiang, FwNianxian = a.FwNianxian, FwMianji = a.FwMianji, FwBiaoJi = b.BiaoJiId, FwBiaoJiID = b.ID, FwColors = b.T_BiaoJiInfo.Colors, FwUserName = b.UserInfo.UName }; return(Json(new { rows = temp, total = userInfoParam.TotalCount }, JsonRequestBehavior.AllowGet)); }
//获取一条我写入的信息 public ActionResult SelOneMyData() { var id = int.Parse(Request["IDs"]); var DelT = T_FGJHtmlDataService.LoadEntities(x => x.ID == id && x.AddItemsUserID == LoginUser.ID).FirstOrDefault(); if (DelT == null) { return(Json(new { ret = "no", msg = "没有找到您要修改的数据,请联系管理员!" }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { temp = DelT }, JsonRequestBehavior.AllowGet)); } }
public int GetSeachdata(long XmsID, int pageIndex, int pageSize) { var CityID = UserInfo_CityService.LoadEntities(x => x.UserInfo_ID == LoginUser.ID).FirstOrDefault(); var totalCount = 0; UserInfoParam Uxms = new UserInfoParam(); var xms = ScrherSAVEService.LoadEntities(x => x.ID == XmsID && x.DEL == 0).FirstOrDefault(); Uxms.PageIndex = pageIndex; Uxms.PageSize = pageSize; Uxms.TotalCount = totalCount; Uxms.ssve = xms; Uxms.C_id = CityID.T_City_ID; T_FGJHtmlDataService.LoadSearchPM(Uxms); return(Uxms.TotalCount); }
//查看电话方法 #region 查看图片 public ActionResult SeeImage() { int id = int.Parse(Request["id"]); var temp = T_FGJHtmlDataService.LoadEntities(x => x.ID == id).FirstOrDefault(); string imageSTR = temp.Image_str; string Masimage = imageSTR.Replace("有---", string.Empty); Masimage = Masimage.Replace("w=242&h=150&", "w=700&h=480&"); if (temp != null) { return(Content(Common.SerializerHelper.SerializeToString(new { serverData = Masimage, msg = "ok" }))); } else { return(Content(Common.SerializerHelper.SerializeToString(new { msg = "no" }))); } }
public ActionResult EditMoney() { var id = Request["ID"] != null?Convert.ToInt64(Request["ID"]) : 0; var EditSumMoney = Convert.ToDecimal(Request["EditSumMoney"]); var Tfg = T_FGJHtmlDataService.LoadEntities(x => x.ID == id).FirstOrDefault(); Tfg.FwSumMoney = (EditSumMoney / 10000).ToString() + "万元"; Tfg.SumMoneyID = GetMoney(Tfg.FwSumMoney); Tfg.Money_int = Convert.ToDecimal(Math.Round(Convert.ToDouble(EditSumMoney / Tfg.Pingmi_int), 2)); if (T_FGJHtmlDataService.EditEntity(Tfg)) { return(Json("ok", JsonRequestBehavior.AllowGet)); } else { return(Json("no", JsonRequestBehavior.AllowGet)); } }
//删除我写入的信息 // public ActionResult delData() { var id = int.Parse(Request["IDs"]); var DelT = T_FGJHtmlDataService.LoadEntities(x => x.ID == id && x.AddItemsUserID == LoginUser.ID).FirstOrDefault(); if (DelT == null) { return(Json(new { ret = "no", msg = "不是本人创建信息不可删除,请联系管理员!" }, JsonRequestBehavior.AllowGet)); } else { if (T_FGJHtmlDataService.DeleteEntity(DelT)) { return(Json(new { ret = "ok", msg = "删除成功!" }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { ret = "no", msg = "在删除过程中出现错误,请联系管理员!" }, JsonRequestBehavior.AllowGet)); } } }
//添加写入信息//修改我写入的信息 public ActionResult AddEditData(T_FGJHtmlData tfhd) { if (tfhd.ID > 0)//修改 { if (T_FGJHtmlDataService.EditEntity(tfhd)) { return(Json(new { ret = "ok", msg = "修改成功" }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { ret = "no", msg = "在修改过程中出现未知错误,请联系管理员!" }, JsonRequestBehavior.AllowGet)); } } else { tfhd.AddItemsUserID = LoginUser.ID; tfhd.Laiyuan = "AddDAT"; tfhd.Pingmi_int = decimal.Parse(Request["FwMianji"]); tfhd.Money_int = decimal.Parse(Request["Smoney"]); tfhd.FwSumMoney = Request["Amoney"] + "万(单价" + tfhd.Money_int + "元/㎡)"; tfhd.FwHuXing = Request["HXs"] + "室" + Request["HXt"] + "厅" + Request["HXw"] + "卫"; tfhd.SumMoneyID = AllClass.GetMoney(Request["Smoney"].ToString()); tfhd.MianjiID = AllClass.GeiMinji(tfhd.FwMianji); tfhd.HuXingID = AllClass.GetHuxing(tfhd.FwHuXing); tfhd.AddUserTiem = MvcApplication.GetT_time(); tfhd.HLhref = ""; tfhd.Image_str = tfhd.Image_str != null?tfhd.Image_str.Trim().Length > 0 ? "有---" + tfhd.Image_str : tfhd.Image_str : tfhd.Image_str; var DisctD = T_FGJHtmlDataService.LoadEntities(x => x.photo == tfhd.photo && x.HLName == tfhd.HLName).FirstOrDefault(); if (DisctD != null) { return(Json(new { ret = "no", msg = "要新增的信息中电话与信息名称在数据库中的有重复,请核对信息在添加!" }, JsonRequestBehavior.AllowGet)); } T_FGJHtmlDataService.AddEntity(tfhd); return(Json(new { ret = "ok", msg = "添加成功!" }, JsonRequestBehavior.AllowGet)); } }
public ActionResult GetHref() { var CityID = UserInfo_CityService.LoadEntities(x => x.UserInfo_ID == LoginUser.ID).FirstOrDefault(); int pageIndex = Request["page"] != null?int.Parse(Request["page"]) : 1; int pageSize = Request["rows"] != null?int.Parse(Request["rows"]) : 35; bool Strb = Request["boot_mp"] != null?Convert.ToBoolean(Request["boot_mp"]) : false; if (Strb) { #region MyRegion var totalCount = int.MaxValue; UserInfoParam Uxms = new UserInfoParam(); if (Request["XmsId"] != null) { #region 小秘书搜索 int XmsID = Request["XmsId"] != null?Convert.ToInt32(Request["XmsId"]) : 0; var xms = ScrherSAVEService.LoadEntities(x => x.ID == XmsID && x.DEL == 0).FirstOrDefault(); addsechmishu(xms); Uxms.PageIndex = pageIndex; Uxms.PageSize = pageSize; Uxms.TotalCount = totalCount; Uxms.ssve = xms; Uxms.C_id = CityID.T_City_ID; #endregion } else { #region 正常搜索 Uxms.PageIndex = pageIndex; Uxms.PageSize = pageSize; Uxms.TotalCount = totalCount; Uxms.Mon1 = Request["Mon1"] != null ? Request["Mon1"].Trim().Length > 0 ? int.Parse(Request["Mon1"]) : 0 : 0; Uxms.Mon2 = Request["Mon2"] != null ? Request["Mon2"].Trim().Length > 0 ? int.Parse(Request["Mon2"]) : 999999 : 999999; Uxms.Pm1 = Request["Pm1"] != null ? Request["Pm1"].Trim().Length > 0 ? int.Parse(Request["Pm1"]) : 0 : 0; Uxms.Pm2 = Request["Pm2"] != null ? Request["Pm2"].Trim().Length > 0 ? int.Parse(Request["Pm2"]) : 99999999 : 99999999; Uxms.quyu = Request["SeQuyu"].ToString(); Uxms.C_id = CityID.T_City_ID; #endregion } var actioninfolist = T_FGJHtmlDataService.LoadSearchPM(Uxms); var UscrClick = T_SeeClickPhotoService.LoadEntities(x => x.UserID == LoginUser.ID).DefaultIfEmpty(); var temp = from a in actioninfolist select new { ID = a.ID, HLName = a.HLName, Image_str = (a.Image_str.IndexOf("有") >= 0 ? "有" : "无"), FbTime = a.FbTime, PersonName = a.PersonName, Address = a.Address, photo = UscrClick.Where(x => x.T_FgjID == a.ID).FirstOrDefault() != null ? a.photo : string.Empty, Laiyuan = a.Laiyuan, FwSumMoney = a.FwSumMoney, FwHuXing = a.FwHuXing, FwLoucheng = a.FwLoucheng, FwZhuangxiu = a.FwZhuangxiu, FwChaoxiang = a.FwChaoxiang, FwNianxian = a.FwNianxian, FwMianji = a.FwMianji }; return(Json(new { rows = temp, total = Uxms.TotalCount }, JsonRequestBehavior.AllowGet)); #endregion } else { string Str = Request["Str"]; var totalCount = int.MaxValue; //构建搜索条件 UserInfoParam userInfoParam = new UserInfoParam() { PageIndex = pageIndex, PageSize = pageSize, TotalCount = totalCount, Str = Str, C_id = CityID.T_City_ID }; if (Request["Tval"] != null) { #region MyRegion string str = Request["Tval"]; string[] list = str.Split(','); for (int i = 0; i < list.Length; i++) { string[] ti = list[i].Split('>'); int cc = int.Parse(ti[0]); var this_i = T_ItemsService.LoadEntities(x => x.ID == cc).FirstOrDefault(); switch (this_i.Icons) { case 0: userInfoParam.money = ti[1].Trim() == "0" ? null : this_i.StrID.ToString(); break; case 1: userInfoParam.Pingmu = ti[1].Trim() == "0" ? null : this_i.StrID.ToString(); break; case 2: userInfoParam.Tingshi = ti[1].Trim() == "0" ? null : this_i.StrID.ToString(); break; case 3: userInfoParam.Zhuanxiu = ti[1].Trim() == "0" ? null : ti[1].ToString().Trim() == "装修" ? null : ti[1]; break; } } #endregion } var temp = GetJson(userInfoParam); return(Json(new { rows = temp, total = userInfoParam.TotalCount }, JsonRequestBehavior.AllowGet)); } }
public object GetJson(UserInfoParam userInfoParam) { var actioninfolist = T_FGJHtmlDataService.LoadSearchFrist(userInfoParam, true, true); #region 基础信息进行查询 if (!string.IsNullOrEmpty(userInfoParam.Zhuanxiu)) { actioninfolist = actioninfolist.Where <T_FGJHtmlData>(u => u.FwZhuangxiu.Contains(userInfoParam.Zhuanxiu)); } if (!string.IsNullOrEmpty(userInfoParam.Pingmu) && userInfoParam.Pingmu.Trim() != "0") { int thiid = int.Parse(userInfoParam.Pingmu); actioninfolist = actioninfolist.Where <T_FGJHtmlData>(u => u.MianjiID == thiid); } if (!string.IsNullOrEmpty(userInfoParam.money) && userInfoParam.money.Trim() != "0") { int thiid = int.Parse(userInfoParam.money); actioninfolist = actioninfolist.Where <T_FGJHtmlData>(u => u.SumMoneyID == thiid); } if (!string.IsNullOrEmpty(userInfoParam.Tingshi) && userInfoParam.Tingshi.Trim() != "0") { int thiid = int.Parse(userInfoParam.Tingshi); actioninfolist = actioninfolist.Where <T_FGJHtmlData>(u => u.HuXingID == thiid); } #endregion #region 根据详细信息进行查询 //if (!string.IsNullOrEmpty(userInfoParam.Mon1.ToString())) //{ // int thiid = int.Parse(userInfoParam.Tingshi); // actioninfolist = actioninfolist.Where<T_FGJHtmlData>(u => u.HuXingID == thiid); //} //if (!string.IsNullOrEmpty(userInfoParam.Mon2.ToString())) //{ // int thiid = int.Parse(userInfoParam.Tingshi); // actioninfolist = actioninfolist.Where<T_FGJHtmlData>(u => u.HuXingID == thiid); //} //if (!string.IsNullOrEmpty(userInfoParam.Pm1.ToString())) //{ // int thiid = int.Parse(userInfoParam.Tingshi); // actioninfolist = actioninfolist.Where<T_FGJHtmlData>(u => u.HuXingID == thiid); //} //if (!string.IsNullOrEmpty(userInfoParam.Pm.ToString())) //{ // int thiid = int.Parse(userInfoParam.Tingshi); // actioninfolist = actioninfolist.Where<T_FGJHtmlData>(u => u.HuXingID == thiid); //} #endregion var UscrClick = T_SeeClickPhotoService.LoadEntities(x => x.UserID == LoginUser.ID).DefaultIfEmpty(); var temp = from a in actioninfolist select new { ID = a.ID, HLName = a.HLName, Image_str = (a.Image_str.IndexOf("有") >= 0 ? "有" : "无"), FbTime = a.FbTime, PersonName = a.PersonName, Address = a.Address, photo = UscrClick.Where(x => x.T_FgjID == a.ID).FirstOrDefault() != null ? a.photo : string.Empty, Laiyuan = a.Laiyuan, FwSumMoney = a.FwSumMoney, FwHuXing = a.FwHuXing, FwLoucheng = a.FwLoucheng, FwZhuangxiu = a.FwZhuangxiu, FwChaoxiang = a.FwChaoxiang, FwNianxian = a.FwNianxian, FwMianji = a.FwMianji }; return(temp); }