Exemplo n.º 1
0
        //获取一条我写入的信息
        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));
            }
        }
Exemplo n.º 2
0
        //查看电话方法
        #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" })));
            }
        }
Exemplo n.º 3
0
        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));
            }
        }
Exemplo n.º 4
0
        //删除我写入的信息
        //
        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));
                }
            }
        }
Exemplo n.º 5
0
        //添加写入信息//修改我写入的信息
        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));
            }
        }