예제 #1
0
 public ActionResult Create(TaskIssuedModel model)
 {
     if (ModelState.IsValid)
     {
         string department = string.Empty;
         if (model.OrganizationList != null && model.OrganizationList.Count > 0)
         {
             for (int i = 0; i < model.OrganizationList.Count; i++)
             {
                 if (i > 0)
                 {
                     department += ",";
                 }
                 department += model.OrganizationList[i].ToString();
             }
         }
         TaskIssuedInfo taskInfo = model.ToInfo();
         taskInfo.Department = department;
         _googleService.Add(taskInfo);
         return(Json(new AjaxResult()
         {
             Result = Result.Success, Message = "操作成功"
         }));
     }
     ViewBag.OrganizationList = DataDictionaryHelper.GetOrganizationList();
     return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model));
 }
예제 #2
0
        public ActionResult Create(CarouselModel model)
        {
            var lujinID = "";

            if (model.DetailsType != null)
            {
                lujinID = DataDictionaryHelper.GetValue((Guid)model.DetailsType);
            }


            if (ModelState.IsValid)
            {
                CarouselInfo info = new CarouselInfo();
                info.Id              = Guid.NewGuid();
                info.Title           = model.Title;
                info.PictureUrl      = model.PictureUrl;
                info.PictureJumpPath = model.PictureJumpPath;
                info.CarouselType    = model.CarouselType;
                info.DetailsType     = model.DetailsType;
                info.LuJing          = lujinID + model.PictureJumpPath;
                service.Add(info);
                return(Json(new AjaxResult()
                {
                    Result = Result.Success
                }));
            }
            return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model));
        }
예제 #3
0
        public ActionResult Edit(MembersModel model)
        {
            model.Status = DataDictionaryHelper.GetId("用户状态>启用");
            if (ModelState.IsValid)
            {
                var info = service.GetById(model.Id);
                if (info != null)
                {
                    info.UserName     = model.UserName;
                    info.UserRealName = model.UserRealName;
                    info.UserType     = model.UserType;
                    info.ImageUrl     = model.ImageUrl;
                    info.Tel          = model.Tel;
                    info.Email        = model.Email;


                    service.Update(info);
                }
                return(Json(new AjaxResult()
                {
                    Result = Result.Success
                }));
            }
            return(View(PluginHelper.GetViewPath(this.GetType(), "Edit"), model));
        }
예제 #4
0
 public ActionResult Create(AnnouncementModel model)
 {
     if (ModelState.IsValid)
     {
         if (model.OrganizationList == null || model.OrganizationList.Count <= 0)
         {
             ModelState.AddModelError("Department", "所属组织不能为空");
             ViewBag.Organization = DataDictionaryHelper.GetOrganizationList();
             return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model));
         }
         string department = string.Empty;
         if (model.OrganizationList != null && model.OrganizationList.Count > 0)
         {
             for (int i = 0; i < model.OrganizationList.Count; i++)
             {
                 if (i > 0)
                 {
                     department += ",";
                 }
                 department += model.OrganizationList[i].ToString();
             }
         }
         model.Department = department;
         service.InsertGoogleProductRecord(model.ToInfo());
         return(Json(new AjaxResult()
         {
             Result = Result.Success, Message = "操作成功"
         }));
     }
     ViewBag.Organization = DataDictionaryHelper.GetOrganizationList();
     return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model));
 }
예제 #5
0
 public ActionResult Edit(TaskIssuedModel model)
 {
     if (ModelState.IsValid)
     {
         var info = _googleService.GetById(model.Id);
         if (info != null)
         {
             info = model.FormData(info);
             string department = string.Empty;
             if (model.OrganizationList != null && model.OrganizationList.Count > 0)
             {
                 for (int i = 0; i < model.OrganizationList.Count; i++)
                 {
                     if (i > 0)
                     {
                         department += ",";
                     }
                     department += model.OrganizationList[i].ToString();
                 }
             }
             info.Department = department;
             _googleService.Update(info);
             return(Json(new AjaxResult()
             {
                 Result = Result.Success, Message = "操作成功"
             }));
         }
     }
     ViewBag.OrganizationList = DataDictionaryHelper.GetOrganizationList();
     return(View(PluginHelper.GetViewPath(this.GetType(), "Edit"), model));
 }
예제 #6
0
        public ActionResult Edit(CarouselModel model)
        {
            var lujinID = "";

            if (model.DetailsType != null)
            {
                lujinID = DataDictionaryHelper.GetValue((Guid)model.DetailsType);
            }
            if (ModelState.IsValid)
            {
                var info = service.GetById(model.Id);
                if (info != null)
                {
                    info.Id              = model.Id;
                    info.Title           = model.Title;
                    info.PictureUrl      = model.PictureUrl;
                    info.PictureJumpPath = model.PictureJumpPath;
                    info.CarouselType    = model.CarouselType;
                    info.DetailsType     = model.DetailsType;
                    info.LuJing          = lujinID + model.PictureJumpPath;
                    service.Update(info);
                }
                return(Json(new AjaxResult()
                {
                    Result = Result.Success
                }));
            }
            return(View(PluginHelper.GetViewPath(this.GetType(), "Edit"), model));
        }
        public IPagedList <MessageOpenAdministrativePunishInfo> SearchNews(MessageOpenAdministrativePunishCondition condition)
        {
            var query = repository.Table;

            if (!string.IsNullOrEmpty(condition.Title))
            {
                query = query.Where(t => t.Title.Contains(condition.Title));
            }
            if (condition.Title != null)
            {
                query = query.Where(t => t.Title == condition.Title);
            }
            if (condition.IsTop != null)
            {
                bool IsTop = bool.Parse(DataDictionaryHelper.GetValue((Guid)condition.IsTop));
                query = query.Where(t => t.IsTop == IsTop);
            }
            if (condition.Department != null)
            {
                query = query.Where(t => t.Department.Contains(condition.Department));
            }
            query = query.Where(t => t.IsDelete == false);
            query = query.OrderByDescending(t => t.IsTop).ThenByDescending(t => t.CreateDate);

            return(new PagedList <MessageOpenAdministrativePunishInfo>(query, condition.PageIndex, condition.PageSize));
        }
예제 #8
0
 public Members_Members Verify(string userName, string password)
 {
     using (CupcakeEntities entity = new CupcakeEntities())
     {
         Guid statusid = DataDictionaryHelper.GetId("用户状态>启用");
         return(entity.Members_Members.Where(u => u.UserName == userName && u.Password == password && u.failLoginCount <= 15 && u.Status == statusid && u.IsDelete == false).SingleOrDefault());
     }
 }
예제 #9
0
        public ActionResult Edit(Guid id)
        {
            var info  = _googleService.GetById(id);
            var model = new TaskIssuedModel().ToModel(info);

            ViewBag.OrganizationList = DataDictionaryHelper.GetOrganizationList();
            return(View(PluginHelper.GetViewPath(this.GetType(), "Edit"), model));
        }
예제 #10
0
 public Members_Members LoginTempPwd(Guid?userId, string tempPassword)
 {
     using (CupcakeEntities entity = new CupcakeEntities())
     {
         Guid statusid = DataDictionaryHelper.GetId("用户状态>启用");
         return(entity.Members_Members.Where(u => u.Id == userId && u.Password == tempPassword && u.IsDelete == false && u.Status == statusid).SingleOrDefault());
     }
 }
예제 #11
0
        public ActionResult Create()
        {
            var model = new TaskIssuedModel();
            var user  = Session["User"] as User;

            model.Publisher          = user.UserName;
            ViewBag.OrganizationList = DataDictionaryHelper.GetOrganizationList();
            return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model));
        }
예제 #12
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult Edit(Guid id)
        {
            var info = service.GetById(id);

            ViewBag.Organization = DataDictionaryHelper.GetOrganizationList();
            var model = new AnnouncementModel().ToModel(info);

            return(View(PluginHelper.GetViewPath(this.GetType(), "Edit"), model));
        }
예제 #13
0
        /// <summary>
        /// 新增
        /// </summary>
        /// <returns></returns>
        public ActionResult Create()
        {
            var model = new AnnouncementModel();

            ViewBag.Organization = DataDictionaryHelper.GetOrganizationList();
            var name = Session["User"] as User;

            model.Name = name.UserName;
            return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model));
        }
예제 #14
0
        public ActionResult Create()
        {
            var model = new MessageOpenAdministrativeIndexModel();
            var name  = Session["User"] as User;

            model.publicName     = name.Name;
            model.publicTime     = DateTime.Now;
            ViewBag.Organization = DataDictionaryHelper.GetOrganizationList();
            return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model));
        }
예제 #15
0
        public ActionResult Edit(Guid id)
        {
            var info = service.GetById(id);

            ViewBag.Organization = DataDictionaryHelper.GetOrganizationList();
            var model = new MessageOpenRightDutyListingModel().ToModel(info);
            var name  = Session["User"] as User;

            model.publicName = name.Name;
            return(View(PluginHelper.GetViewPath(this.GetType(), "Edit"), model));
        }
예제 #16
0
        public ActionResult ActivitiesState(Guid id, string State)
        {
            ActivitysModel model = new ActivitysModel();
            var            info  = service.GetById(id);

            if (info != null)
            {
                info.ActityState = DataDictionaryHelper.GetDictionary(State).Id;
                service.UpdateGoogleProductRecord(info);
                return(Json(new AjaxResult()
                {
                    Result = Result.Success, Message = "操作成功"
                }));
            }
            return(View(PluginHelper.GetViewPath(this.GetType(), "ActivitiesState"), model));
        }
예제 #17
0
        //public Members_Members Get(Expression<Func<Members_Members, bool>> filterExpression)
        //{
        //    using (CupcakeEntities entity = new CupcakeEntities())
        //    {
        //        return entity.Members_Members.Where(filterExpression).SingleOrDefault();
        //    }
        //}

        public Members_Members AddReturn1(Members_Members info)
        {
            using (CupcakeEntities entity = new CupcakeEntities())
            {
                Guid statusid    = DataDictionaryHelper.GetId("用户状态>启用");
                Guid usertypesid = DataDictionaryHelper.GetId("用户类型>普通用户");
                info.UpdateDate = DateTime.Now;
                info.CreateDate = DateTime.Now;
                info.Status     = statusid;
                info.UserType   = usertypesid;
                info.IsDelete   = false;
                info.Id         = Guid.NewGuid();
                entity.Members_Members.Add(info);
                return(entity.Members_Members.Where(p => p.Id == info.Id).SingleOrDefault());
            }
        }
예제 #18
0
        public ActionResult Enable(Guid id)
        {
            MembersModel model = new MembersModel();
            var          info  = service.GetById(id);

            if (info != null)
            {
                info.Status = DataDictionaryHelper.GetId("用户状态>启用");
                service.Update(info);
                return(Json(new AjaxResult()
                {
                    Result = Result.Success
                }));
            }

            return(View(PluginHelper.GetViewPath(this.GetType(), "Index")));
        }
예제 #19
0
        public static PluginsModel ToModel(this Plugins entity)
        {
            var model = new PluginsModel();

            model.Id             = entity.Id;
            model.Group          = entity.Group;
            model.SystemName     = entity.SystemName;
            model.FriendlyName   = entity.FriendlyName;
            model.BigVersion     = entity.BigVersion;
            model.SmallVersion   = entity.SmallVersion;
            model.Author         = entity.Author;
            model.Description    = entity.Description;
            model.PluginType     = entity.PluginType;
            model.CreateDate     = entity.CreateDate;
            model.PluginTypeName = DataDictionaryHelper.GetName(entity.PluginType);

            return(model);
        }
예제 #20
0
        public ActionResult Index(string fileType, string fileExts, int?fileLimit, string fileSizeLimit, string scopes, string thumbnail, string width, string height)
        {
            if (string.IsNullOrEmpty(fileType))
            {
                throw new NopException("参数不正确");
            }
            var dataDictionary = DataDictionaryHelper.Get(fileType);

            //var a = HttpContext.User;
            ViewBag.FileType      = dataDictionary.Id;
            ViewBag.FileExts      = dataDictionary.Value ?? fileExts;
            ViewBag.FileLimit     = fileLimit ?? 0;
            ViewBag.FileSizeLimit = fileSizeLimit ?? "0";
            ViewBag.Scopes        = scopes ?? "private";
            ViewBag.Thumbnail     = thumbnail.ToLower() ?? "";
            ViewBag.Width         = width ?? "";
            ViewBag.Height        = height ?? "";
            return(View());
        }
        public ActionResult Create(MessageOpenInstitutionalModel model)
        {
            if (ModelState.IsValid)
            {
                //if (model.OrganizationList == null || model.OrganizationList.Count <= 0)
                //{
                //    ModelState.AddModelError("Department", "所属组织不能为空");
                //    ViewBag.Organization = DataDictionaryHelper.GetOrganizationList();
                //    return View(PluginHelper.GetViewPath(this.GetType(), "Create"), model);

                //}
                //string department = string.Empty;
                //if (model.OrganizationList != null && model.OrganizationList.Count > 0)
                //{
                //    for (int i = 0; i < model.OrganizationList.Count; i++)
                //    {
                //        if (i > 0)
                //        {
                //            department += ",";
                //        }
                //        department += model.OrganizationList[i].ToString();
                //    }
                //}
                //model.Department = department;
                int result = service.GetAddMessageOpenInstitutionalCount(model.Institutional);
                if (result > 0)
                {
                    ModelState.AddModelError("Institutional", "此项已存在");
                }
                else
                {
                    service.Add(model.ToInfo());
                    return(Json(new AjaxResult()
                    {
                        Result = Result.Success
                    }));
                }
            }
            ViewBag.Organization = DataDictionaryHelper.GetOrganizationList();
            return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model));
        }
예제 #22
0
 public ActionResult Edit(MessageOpenRightDutyListingModel model)
 {
     if (ModelState.IsValid)
     {
         if (model.OrganizationList == null || model.OrganizationList.Count <= 0)
         {
             ModelState.AddModelError("Department", "所属组织不能为空");
             ViewBag.Organization = DataDictionaryHelper.GetOrganizationList();
             return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model));
         }
         string department = string.Empty;
         if (model.OrganizationList != null && model.OrganizationList.Count > 0)
         {
             var OrganizationId = DataDictionaryHelper.GetOrganizationByName("所属组织");
             for (int i = 0; i < model.OrganizationList.Count; i++)
             {
                 if (model.OrganizationList[i] != OrganizationId)
                 {
                     if (i > 0)
                     {
                         department += ",";
                     }
                     department += model.OrganizationList[i].ToString();
                 }
             }
         }
         var info = service.GetById(model.Id);
         model.Department = department;
         if (info != null)
         {
             info = model.FormData(info);
             service.Update(info);
             return(Json(new AjaxResult()
             {
                 Result = Result.Success
             }));
         }
     }
     return(View(PluginHelper.GetViewPath(this.GetType(), "Edit"), model));
 }
예제 #23
0
        public ActionResult Create(PluginsModel model)
        {
            if (ModelState.IsValid)
            {
                if (service.AlreadyExists(model.SystemName, Guid.Empty))
                {
                    ModelState.AddModelError("SystemName", "系统名重复");
                }
                else
                {
                    var entity = model.ToEntity();
                    entity.Group      = "Reloadsoft";
                    entity.PluginType = DataDictionaryHelper.GetId("插件状态>已注册");

                    service.InsertPlugin(entity);
                    return(Json(new AjaxResult()
                    {
                        Result = Result.Success
                    }));
                }
            }
            return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model));
        }
 public ActionResult Create(MessageOpenAdministrativePunishModel model)
 {
     if (ModelState.IsValid)
     {
         if (model.OrganizationList == null || model.OrganizationList.Count <= 0)
         {
             ModelState.AddModelError("Department", "所属组织不能为空");
             ViewBag.Organization = DataDictionaryHelper.GetOrganizationList();
             return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model));
         }
         string department = string.Empty;
         if (model.OrganizationList != null && model.OrganizationList.Count > 0)
         {
             var OrganizationId = DataDictionaryHelper.GetOrganizationByName("所属组织");
             for (int i = 0; i < model.OrganizationList.Count; i++)
             {
                 if (model.OrganizationList[i] != OrganizationId)
                 {
                     if (i > 0)
                     {
                         department += ",";
                     }
                     department += model.OrganizationList[i].ToString();
                 }
             }
         }
         model.Department = department;
         service.Add(model.ToInfo());
         return(Json(new AjaxResult()
         {
             Result = Result.Success
         }));
     }
     ViewBag.Organization = DataDictionaryHelper.GetOrganizationList();
     return(View(PluginHelper.GetViewPath(this.GetType(), "Create"), model));
 }
예제 #25
0
        public ActionResult Upload(Guid fileType, string scopes, string thumbnail, string width, string height, HttpPostedFileBase fileData)
        {
            if (fileData != null)
            {
                var result = FileHelper.SaveFile(fileData);

                Image  originalImage         = null;
                string thumbnailRelativePath = "";
                if (IsImage(result.ExtensionName))
                {
                    originalImage = Image.FromFile(result.Path);
                    //系统默认缩略图
                    if (originalImage.Width > 138)
                    {
                        string thumbnailPhysicalPath = result.Path.Replace(result.ExtensionName, "") + "_d" + result.ExtensionName;
                        ThumbnailHelper.Thumbnail(originalImage, thumbnailPhysicalPath, 138, 0, "w");
                        thumbnailRelativePath = result.RelativePath.Replace(result.ExtensionName, "") + "_d" + result.ExtensionName;
                    }
                    else
                    {
                        thumbnailRelativePath = result.RelativePath;
                    }
                    //自定义缩略图
                    if (!string.IsNullOrEmpty(thumbnail))
                    {
                        string thumbnailPathSmall = result.Path.Replace(result.ExtensionName, "") + "_s" + result.ExtensionName;
                        ThumbnailHelper.Thumbnail(originalImage, thumbnailPathSmall, string.IsNullOrEmpty(width) ? 0 : Int32.Parse(width), string.IsNullOrEmpty(height) ? 0 : Int32.Parse(height), thumbnail);
                    }
                }
                else
                {
                    if (DataDictionaryHelper.GetValue("媒体类型>Office文件").Contains(result.ExtensionName))
                    {
                        if (".doc;.docx;.rtf;.dotx;.dot;".Contains(result.ExtensionName))
                        {
                            thumbnailRelativePath = "/Content/img/doc.jpg";
                        }
                        else if (".xls;.xlsx;.xlt;.xltx;".Contains(result.ExtensionName))
                        {
                            thumbnailRelativePath = "/Content/img/xls.jpg";
                        }
                        else
                        {
                            thumbnailRelativePath = "/Content/img/office.png";
                        }
                    }
                    else if (result.ExtensionName == ".txt")
                    {
                        thumbnailRelativePath = "/Content/img/txt.png";
                    }
                    else if (".rar;.zip".Contains(result.ExtensionName))
                    {
                        thumbnailRelativePath = "/Content/img/rar.png";
                    }
                    else
                    {
                        thumbnailRelativePath = "/Content/img/file.png";
                    }
                }

                //公共media会保存到数据
                //if (scopes.ToLower() == "public")
                //{
                var mediaService = new MediaService();
                var media        = new Media()
                {
                    FileName      = fileData.FileName,
                    ExtensionName = result.ExtensionName,
                    FilePath      = urlconvertor(result.Path),
                    MediaType     = fileType,
                    ThumbnailPath = thumbnailRelativePath
                };
                if (scopes.ToLower() == "public")
                {
                    media.IsPublic = true;
                }
                else
                {
                    media.IsPublic = false;
                }
                if (originalImage != null)
                {
                    media.Width  = originalImage.Width;
                    media.Height = originalImage.Height;
                }
                mediaService.Add(media);
                //}
                if (originalImage != null)
                {
                    originalImage.Dispose();
                }
                result.Id            = media.Id.ToString();
                result.ThumbnailPath = thumbnailRelativePath;
                result.Width         = media.Width == null ? "" : media.Width.GetValueOrDefault().ToString();
                result.Height        = media.Height == null ? "" : media.Height.GetValueOrDefault().ToString();
                return(Json(result));
            }
            else
            {
                return(Json(new AjaxResult()
                {
                    Result = Result.Error, Message = "未找到该文件流"
                }));
            }
        }