public ActionResult Add(string def, string catagory, string exa, string keyword)
        {
            UserContent rawdata = new UserContent();

            rawdata.UserId   = (Guid)Membership.GetUser().ProviderUserKey;
            rawdata.Catagory = !String.IsNullOrEmpty(catagory) ? catagory : "";
            rawdata.Keyword  = !String.IsNullOrEmpty(keyword) ? keyword : "";
            rawdata.Def      = !String.IsNullOrEmpty(def) ? def : "";
            rawdata.Exa      = !String.IsNullOrEmpty(exa) ? exa : "";
            rawdata.DateAdd  = DateTime.Now;

            string message = "";

            AddContentModel model = new AddContentModel();

            if (model.Add(rawdata) > 0)
            {
                message = "SUCCESS";
            }
            else
            {
                message = "FAIL";
            }

            return(Json(new { message = message }));
        }
Exemple #2
0
 public IActionResult AddContent(AddContentModel model)
 {
     try
     {
         if (ModelState.IsValid)
         {
             ContentDetails contentModel = ContentHelper.BindContentDetailsModel(model);
             long           contentId    = iContent.AddContent(contentModel);
             if (contentId > 0)
             {
                 return(Ok(ResponseHelper.Success(MessageConstants.ContentAdded)));
             }
             else if (contentId == ReturnCode.AlreadyExist.GetHashCode())
             {
                 return(Ok(ResponseHelper.Error(MessageConstants.TryDifferentNameShortName)));
             }
             else
             {
                 return(Ok(ResponseHelper.Error(MessageConstants.ContentNotAdded)));
             }
         }
         else
         {
             return(Ok(ResponseHelper.Error(MessageConstants.CompulsoryData)));
         }
     }
     catch (Exception ex)
     {
         LogHelper.ExceptionLog(ex.Message + "  :::::  " + ex.StackTrace);
         return(Ok(ResponseHelper.Error(ex.Message)));
     }
 }
Exemple #3
0
 public IActionResult ContentDetails(ContentDetailModel contentModel)
 {
     try
     {
         if (ModelState.IsValid)
         {
             var contentDetailModel = iContent.GetContentDetail(contentModel.shortName);
             if (contentDetailModel != null)
             {
                 AddContentModel addContentModel = ContentHelper.BindContentDetailsModel(contentDetailModel);
                 return(Ok(ResponseHelper.Success(addContentModel)));
             }
             else
             {
                 return(Ok(ResponseHelper.Error(MessageConstants.ContentNotFound)));
             }
         }
         else
         {
             return(Ok(ResponseHelper.Error(MessageConstants.CompulsoryData)));
         }
     }
     catch (Exception ex)
     {
         LogHelper.ExceptionLog(ex.Message + "  :::::  " + ex.StackTrace);
         return(Ok(ResponseHelper.Error(ex.Message)));
     }
 }
        //GET: /AddContent/List
        public ActionResult Index(int?page)
        {
            int             pageNumber = page ?? 1;
            AddContentModel model      = new AddContentModel();

            Guid userId = (Guid)Membership.GetUser().ProviderUserKey;

            ViewBag.AddContentList = model.GetAllAddContentByUser(pageNumber, 10, userId);

            return(View());
        }
Exemple #5
0
        //
        // GET: /ManageContent/

        public ActionResult Index(int?page)
        {
            var pageNumber = page ?? 1;
            int size       = 10;

            AddContentModel addContentModel = new AddContentModel();

            AddContentViewModel viewModel = new AddContentViewModel();

            viewModel.UserContents = addContentModel.GetAllAddContent(pageNumber, size);

            return(View(viewModel));
        }
Exemple #6
0
        /// <summary>
        /// Converts to content details model.
        /// </summary>
        /// <param name="contentDetails">The model.</param>
        /// <returns></returns>
        public static AddContentModel BindContentDetailsModel(ContentDetails contentDetails)
        {
            AddContentModel addContentModel = new AddContentModel();

            if (contentDetails != null)
            {
                addContentModel.ContentId   = contentDetails.ContentId;
                addContentModel.ShortName   = contentDetails.ShortName;
                addContentModel.Name        = contentDetails.Name;
                addContentModel.Description = contentDetails.Description;
            }
            return(addContentModel);
        }
        public ActionResult Delete(int rawDataId)
        {
            AddContentModel addContentModel = new AddContentModel();
            int             result          = addContentModel.DeleteAddContent(rawDataId);

            if (result > 0)
            {
                return(Json(new { message = "SUCCESS" }));
            }
            else
            {
                return(Json(new { message = "FAIL" }));
            }
        }
Exemple #8
0
        /// <summary>
        /// Converts to content details model.
        /// </summary>
        /// <param name="addContentModel">The model.</param>
        /// <returns></returns>
        public static ContentDetails BindContentDetailsModel(AddContentModel addContentModel)
        {
            ContentDetails contentDetails = new ContentDetails();

            if (addContentModel != null)
            {
                contentDetails.ContentId   = addContentModel.ContentId;
                contentDetails.ShortName   = addContentModel.ShortName;
                contentDetails.Name        = addContentModel.Name;
                contentDetails.Description = addContentModel.Description;
                contentDetails.CreatedOn   = DateTime.Now;
                contentDetails.CreatedBy   = DBHelper.ParseInt64(addContentModel.CreatedBy);
                contentDetails.UpdatedBy   = DBHelper.ParseInt64(addContentModel.UpdatedBy);
            }
            return(contentDetails);
        }
Exemple #9
0
 public SelectionAdapter(Context c, AddContentModel model)
 {
     context    = c;
     this.model = model;
 }
Exemple #10
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            Window = new UIWindow (UIScreen.MainScreen.Bounds);

            // System version checks
            if (int.Parse (UIDevice.CurrentDevice.SystemVersion.Split ('.') [0]) < 7) {
                IsSeven = false;
            }
            else {
                IsSeven = true;
            }

            // Init the singletons oi oi
            MainCategories = new AddContentModel ();
            MainCategories.Categories = new List<AddContentItem> ();
            SubCategories = new AddContentModel ();
            SubCategories.Categories = new List<AddContentItem> ();

            var tabbar = new MainTabController ();
            Window.RootViewController = tabbar;

            FBSettings.DefaultAppID = FbAppId;
            FBSettings.DefaultDisplayName = "Sport.Net";

            UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.LightContent;
            Window.MakeKeyAndVisible ();
            return true;
        }
Exemple #11
0
        public ActionResult AddContent(AddContentModel addContentModel)
        {
            var result = StorageHelper.InsertContent(addContentModel);

            return(Json(new { success = result }));
        }
        public IActionResult Add([FromRoute] Guid id, [FromBody] AddContentModel model)
        {
            var result = DispatchCommand(new AddContentCommand(model, User.GetUserEmail().Value, id));

            return(result.AsActionResult(() => Created("api/content", model)));
        }