Example #1
0
        public ActionResult AddXuQiuPicData()
        {
            var Title  = Request["Title"];
            var Memo   = Request["Memo"];
            var ImgUrl = Request["ImgUrl"];
            int picCnt = 0;//图片



            //图片
            if (!string.IsNullOrEmpty(ImgUrl))
            {
                tb_Pictuer pic = new tb_Pictuer();
                pic.PicTitle = Title;
                pic.OrderID  = "需求主图";
                pic.PicUrl   = ImgUrl;
                pic.Memo     = Memo;
                picCnt       = DemandBLL.PictureIns(pic);
            }


            if (!string.IsNullOrEmpty(ImgUrl) && picCnt <= 0)
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "需求图片提交失败,请联系管理员!"));
            }

            return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "需求图片提交成功!", null, "/UploadFile/UploadPicture/"));
        }
Example #2
0
        public ActionResult AddClassCareData()
        {
            var OrderID  = Request["OrderID"];
            var Title    = Request["Title"];
            var Memo     = Request["Memo"];
            var VideoUrl = Request["VideoUrl"];
            var ImgUrl   = Request["ImgUrl"];
            //var OrderClassify = Request["OrderClassify"];
            //var OrderType = Request["OrderType"];
            //var OrderIntro = Request["OrderIntro"];
            //var OrderID = Utility.GetNewGUID();
            int picCnt   = 0; //图片
            int videoCnt = 0; //视频


            //图片
            if (!string.IsNullOrEmpty(ImgUrl))
            {
                tb_Pictuer pic = new tb_Pictuer();
                pic.PicTitle = Title;
                pic.OrderID  = OrderID;
                pic.PicUrl   = ImgUrl;
                pic.Memo     = Memo;
                picCnt       = DemandBLL.PictureIns(pic);
            }

            //视频
            if (!string.IsNullOrEmpty(VideoUrl))
            {
                tb_Video video = new tb_Video();
                video.VideoTitle = Title;
                video.OrderID    = OrderID;
                video.VideoUrl   = VideoUrl;
                video.Memo       = Memo;
                videoCnt         = DemandBLL.VideoIns(video);
            }
            if (!string.IsNullOrEmpty(ImgUrl) && picCnt <= 0)
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "图片提交失败,请联系管理员!"));
            }
            if (!string.IsNullOrEmpty(VideoUrl) && videoCnt <= 0)
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "视频提交失败,请联系管理员!"));
            }

            return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "信息提交成功请查看详情!", null, "/MemberM/AdminClassCare/"));
        }
Example #3
0
 /// <summary>
 /// 新增图片
 /// </summary>
 /// <param name="pic"></param>
 /// <returns></returns>
 public static int PictureIns(tb_Pictuer pic)
 {
     using (CareCenterEntities entity = new CareCenterEntities())
     {
         try
         {
             int count = 0;
             pic.PicID               = Utility.GetNewGUID();
             pic.Status              = 1;
             pic.CreateDate          = Utility.GetSysDateTime();
             entity.Entry(pic).State = System.Data.Entity.EntityState.Added;
             entity.SaveChanges();
             count = 1;
             return(count);
         }
         catch (Exception ex)
         {
             throw ex;
         }
     }
 }
Example #4
0
        /// <summary>
        /// 上传多图片并发布新房源
        /// </summary>
        /// <param name="file"></param>
        /// <returns></returns>
        public ActionResult UploadManyImgData(HttpPostedFileBase file)
        {
            //var TotalData = Request["TotalData"];//总数据
            var imgUrl = string.Empty;                  //写入数据库地址
            HttpPostedFileBase ImgPath  = file;         // files["ImgPath"];//主图片
            string             TempName = string.Empty; //图片新名称

            //文件存放位置
            string path = ConfigHelper.GetAppSettingString("PicPath");

            //存入文件新名称
            TempName = Utility.ImgUpload(ImgPath, path);

            //写入数据库地址
            imgUrl = ConfigHelper.GetAppSettingString("ImgPath") + TempName;
            //Session[""+ sessiondate + ""] = imgUrl;//存储上传图片地址

            var PicTitle = Request["PicTitle"];
            var Memo     = Request["Memo"];//简介
            //多图片插入
            tb_Pictuer MentPic = new tb_Pictuer();

            MentPic.PicTitle = PicTitle;
            MentPic.PicUrl   = imgUrl;
            MentPic.OrderID  = "精彩瞬间";
            MentPic.Memo     = Memo;
            int count = DemandBLL.PictureIns(MentPic);

            if (count > 0)
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "精彩瞬间发布成功", null, "/UploadFile/UploadPicture/"));
            }
            else
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "精彩瞬间发布失败,请联系管理员!"));
            }
        }
        public ActionResult SetOwnNeedData()
        {
            var Title         = Request["Title"];
            var Memo          = Request["Memo"];
            var VideoUrl      = Request["VideoUrl"];
            var ImgUrl        = Request["ImgUrl"];
            var OrderClassify = Request["OrderClassify"];
            var OrderType     = Request["OrderType"];
            var OrderIntro    = Request["OrderIntro"];
            var OrderID       = Utility.GetNewGUID();
            var PersonInro    = Request["PersonInro"];//被照护人情况
            var Address       = Request["Address"];
            var CeraRange     = Request["CeraRange"];
            var DateType      = Request["DateType"];// 照护方式  如:4H(半天)、10h(白天)、24h(全天)
            var CarePerson    = Request["CarePerson"];
            var CareAddress   = Request["CareAddress"];
            int picCnt        = 0;                                      //图片
            int videoCnt      = 0;                                      //视频
            var userphone     = User.Identity.Name;
            var userInfo      = HomeBLL.GetUserInfoByPhone(userphone);; //获取用户信息

            //需求数据
            tb_Order order = new tb_Order();

            order.UserID        = userInfo.ID;
            order.OrderID       = OrderID;
            order.OrderTitle    = Title;
            order.OrderType     = OrderType;
            order.OrderClassify = Convert.ToInt32(OrderClassify);
            order.Memo          = Memo;
            order.OrderIntor    = OrderIntro;
            order.PersonInro    = PersonInro;
            order.Address       = Address;
            order.CeraRange     = CeraRange;
            order.DateType      = DateType;
            order.CarePerson    = CarePerson;
            order.CareAddress   = CareAddress;



            int count     = DemandBLL.OwnNeedDataIns(order);
            var ordertemp = UserBLL.GetOrderDataBYOrderID(OrderID);

            if (count > 0 && ordertemp != null)
            {
                //图片
                if (!string.IsNullOrEmpty(ImgUrl))
                {
                    tb_Pictuer pic = new tb_Pictuer();
                    pic.OrderID = OrderID;
                    pic.PicUrl  = ImgUrl;
                    picCnt      = DemandBLL.PictureIns(pic);
                }

                //视频
                if (!string.IsNullOrEmpty(VideoUrl))
                {
                    tb_Video video = new tb_Video();
                    video.OrderID  = OrderID;
                    video.VideoUrl = VideoUrl;
                    videoCnt       = DemandBLL.VideoIns(video);
                }
                if (!string.IsNullOrEmpty(ImgUrl) && picCnt <= 0)
                {
                    return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "图片提交失败,请联系管理员!"));
                }
                if (!string.IsNullOrEmpty(VideoUrl) && videoCnt <= 0)
                {
                    return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "视频提交失败,请联系管理员!"));
                }

                return(OperContext.PackagingAjaxMsg(AjaxStatu.ok, "需求提交成功请至个人中心查看!", null, "/User/OwnNeed/"));
            }
            else
            {
                return(OperContext.PackagingAjaxMsg(AjaxStatu.err, "需求提交失败,请联系管理员!"));
            }
        }