public ActionResult AdminStoriesExcel(string category, string subcategory, string rating, string market, string events, string searchname) { StoryBL _storybl = new StoryBL(); IList <StoryModel> stories = _storybl.GetAll(category, subcategory, rating, market, events, searchname); StoryCategoryBL _storycatbl = new StoryCategoryBL(); StoryCategoryModel _storycat; StorySubCategoryBL _storysubcatbl = new StorySubCategoryBL(); StorySubCategoryModel _storysubcat; StoryRatingBL _ratingbl = new StoryRatingBL(); StoryRatingModel _rating; ProfileBL _profilebl = new ProfileBL(); ProfileModel _profile; foreach (StoryModel m in stories) { decimal dCategory = (m.STORY_CATEGORY == null ? 0 :(decimal)m.STORY_CATEGORY); decimal dsubCategory = (m.STORY_SUBCATEGORY == null ? 0 : (decimal)m.STORY_SUBCATEGORY); decimal dRating = (m.STORY_RATING == null ? 0 : (decimal)m.STORY_RATING); _storycat = _storycatbl.GetStoryCategoryModelByID(dCategory); _storysubcat = _storysubcatbl.GetStorySubCategoryModelByID(dsubCategory); _rating = _ratingbl.GetStoryRatingModelByID(dRating); _profile = _profilebl.GetProfileByStarzId(m.STARS_ID); m.Category = _storycat; m.SubCategory = _storysubcat; m.Rating = _rating; m.Profile = _profile; } return(PartialView(stories)); }
public ActionResult LBCProfile(string ID = null) { if (Convert.ToInt32(Session["ROLE_ID"]) == 5 || Convert.ToInt32(Session["ROLE_ID"]) == 4 || Convert.ToInt32(Session["ROLE_ID"]) == 2) { ViewBag.homeid = "profile"; } else { ViewBag.homeid = "home"; } ProfileModel model = new ProfileModel(); ProfileBL _profile = new ProfileBL(); ProfileRecognitionMasterBL _recognition = new ProfileRecognitionMasterBL(); ProfileRecognitionBL _recog = new ProfileRecognitionBL(); var _id = System.Web.HttpContext.Current.Session["w_user"].ToString(); if (ID == null || Convert.ToInt32(Session["ROLE_ID"]) == 1) { model = _profile.GetProfileBy(_id); model.recognitionList = _recog.GetAll(Session["StarsIdProfile"].ToString()); //model.recognitionList = _recognition.GetByStarsId(Session["StarsIdProfile"].ToString()); } else { model = _profile.GetProfileByStarzId(ID); model.recognitionList = _recog.GetAll(ID); //model.recognitionList = _recognition.GetByStarsId(ID); } if (model != null) { if (!String.IsNullOrWhiteSpace(model.DLR_PHONE)) { model.phone1 = model.DLR_PHONE.Substring(0, 3); model.phone2 = model.DLR_PHONE.Substring(3, 3); model.phone3 = model.DLR_PHONE.Substring(6, 4); } if (!String.IsNullOrWhiteSpace(model.PHONE) && model.PHONE.Length == 10) { model.mobile1 = model.PHONE.Substring(0, 3); model.mobile2 = model.PHONE.Substring(3, 3); model.mobile3 = model.PHONE.Substring(6, 4); } else { model.mobile1 = null; model.mobile2 = null; model.mobile3 = null; model.PHONE = null; } } // model.recognitionMasterList = _recognition.GetAll(); // model.recognitionList = _recog.GetAll(starzId); return(View(model)); }
public ActionResult SaveStoryUser(StoryModel model, string SaveStory, HttpPostedFileBase IMG1, HttpPostedFileBase IMG2, HttpPostedFileBase IMG3) { ProfileModel tProfile = new ProfileModel(); model.STARS_ID = Session["StarsIdProfile"].ToString(); tProfile = profile.GetProfileByStarzId(model.STARS_ID); model.PA_CODE = tProfile.PA_CODE; //Session["w_pacode"].ToString(); model.UPDATED_BY = System.Web.HttpContext.Current.Session["w_user"].ToString(); model.STORY_STATUS = (SaveStory == "Save DRAFT" ? "DRAFT" : "FINAL"); model.CREATED_BY = Session["User_Id"].ToString(); model.CREATED_DATE = DateTime.Now; if (IMG1 != null) { model.IMG_1 = Upload(IMG1, model.PA_CODE); } if (IMG2 != null) { model.IMG_2 = Upload(IMG2, model.PA_CODE); } if (IMG3 != null) { model.IMG_3 = Upload(IMG3, model.PA_CODE); } if (SaveStory != "Save DRAFT") { model.SUBMISION_DATE = DateTime.Now; model.STORY_RATING = 0; //default rating model.STORY_SUBCATEGORY = 10; //default uncategoiry } if (model.SEQ_ID == 0) //new story { _storybl.SaveStory(model); } else { model.SEQ_ID = model.SEQ_ID; model.UPDATED_DATE = DateTime.Now; _storybl.UpdateStory(model); } return(RedirectToAction("Index")); }
public ActionResult AdminEdit(StoryModel model, string save, string category, string subcategory, string reason, string messagebody, int?id) { StoryModel story = new StoryModel(); if (id != null) { int pID = (int)id; story = _storybl.getStoriesBySEQID(pID); } if (save == "CANCEL") { return(View(story)); } ViewBag.homeid = "story"; //string rating =(Request.Form.Get("rating")==null?"0":Request.Form.Get("rating").ToString()); model.STORY_STATUS = (save == "SAVE STORY >" ? "FINAL":"DRAFT"); if (save == "SAVE STORY >" || save == null) { //model.STORY_CATEGORY = int.Parse(category); //model.STORY_SUBCATEGORY = int.Parse(subcategory); if (model.STORY_RATING == 0) { PrepareProfile(model.STARS_ID); return(View(story)); } } else { //Return to Draft ProfileModel _profile = new ProfileModel(); ProfileBL _pbl = new ProfileBL(); _profile = _pbl.GetProfileByStarzId(story.STARS_ID); EmailHelper.SendReturnDraftEMail(_profile.EMAIL_ID, reason, messagebody); } model.UPDATED_BY = System.Web.HttpContext.Current.Session["w_user"].ToString(); model.UPDATED_DATE = DateTime.Now; model.SUBMISION_DATE = model.SUBMISION_DATE; model.SEQ_ID = model.SEQ_ID; _storybl.UpdateStory(model); return(RedirectToAction("AdminStories")); }