public ActionResult Welcome()
        {
            ViewBag.homeid = "home";
            ProfileBL    _profile = new ProfileBL();
            ProfileModel model    = new ProfileModel();
            var          _id      = System.Web.HttpContext.Current.Session["w_user"].ToString();
            var          paCode   = System.Web.HttpContext.Current.Session["w_pacode"].ToString();
            var          _popUp   = System.Web.HttpContext.Current.Session["ShowPopUpS"];

            //bool _showVideo = Convert.ToBoolean(Session["showVideo"]);
            model.WSLX_ID = _id;
            model.PA_CODE = paCode;

            if (_popUp != null)
            {
                if ((bool)_popUp == true)
                {
                    model.haveProfileWslxId = false;
                    return(View(model));
                }
            }
            else
            {
                model.haveProfileWslxId = true;
            }
            //if (_showVideo != false)
            //{
            //    return RedirectToAction("Video", "LBC");
            //}

            return(View(model));
        }
        public IHttpActionResult GetUserLatestActivity(UserIdAndUserType model)
        {
            StringBuilder traceLog = null;
            ServiceResponse <ViewPostVM> objResponse = null;

            try
            {
                traceLog = new StringBuilder();
                traceLog.AppendLine("Start: GetUserLatestActivity() Request Data:-UserId" + model.UserId + ",UserType-" + model.UserType);
                objResponse              = new ServiceResponse <ViewPostVM>();
                objResponse.jsonData     = ProfileBL.GetUserTrainerLatestActivity(model.UserId, model.UserType);
                objResponse.IsResultTrue = true;
                return(Ok(objResponse));
            }
            catch (Exception ex)
            {
                LogManager.LogManagerInstance.WriteErrorLog(ex);
                return(BadRequest(ex.Message));
            }
            finally
            {
                traceLog.AppendLine("End:GetUserLatestActivity() Response Result Status-" + objResponse.IsResultTrue + ",Fetched DateTime-" + DateTime.Now.ToLongDateString());
                LogManager.LogManagerInstance.WriteTraceLog(traceLog);
                traceLog = null;
            }
        }
        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));
        }
示例#4
0
        public ActionResult <ProfileResponseModel> GetProfile([FromBody] ProfileInputModel data)
        {
            try
            {
                ProfileBL profileBL = new ProfileBL(DbContext);
                var       res       = profileBL.GetCompleteProfie(data.UserID);
                res.PPNDefault = AppSettings.PPNDefault;

                ProfileResponseModel response = new ProfileResponseModel();

                response.data     = res;
                response.Message  = "Success";
                response.Response = true;

                return(response);
            }
            catch (Exception ex)
            {
                ProfileResponseModel logres = new ProfileResponseModel();
                logres.Message  = ex.Message;
                logres.Response = false;

                return(logres);
            }
        }
        private void btnGrabar_Click(object sender, System.EventArgs e)
        {
            try
            {
                Cursor = Cursors.WaitCursor;
                if (!ValidarIngreso())
                {
                    ProfileBL objBL_Perfil = new ProfileBL();

                    ProfileBE objPerfil = new ProfileBE();
                    objPerfil.IdProfile = IdProfile;
                    objPerfil.NameProfile = txtDescripcion.Text;
                    objPerfil.FlagState = chkEstado.Checked;
                    objPerfil.Login = Parametros.strUsuarioLogin;
                    objPerfil.Machine = WindowsIdentity.GetCurrent().Name.ToString();
                    objPerfil.IdCompany = Parametros.intEmpresaId;
                   
                    if (pOperacion == Operacion.Nuevo)
                        objBL_Perfil.Inserta(objPerfil, pListaAccess);
                    else
                        objBL_Perfil.Actualiza(objPerfil, pListaAccess);

                    this.Close(); 
                }
            }
            catch (Exception ex)
            {
                Cursor = Cursors.Default;
                XtraMessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        public ActionResult Register(RegistrationModel Model)
        {
            ProfileModel _prModel = new ProfileModel();

            _prModel.STARS_ID            = Model.STARS_ID;
            _prModel.PA_CODE             = Model.PA_CODE;
            _prModel.DLR_NAME            = Model.DLR_NAME;
            _prModel.FIRST_NAME          = Model.FIRST_NAME;
            _prModel.LAST_NAME           = Model.LAST_NAME;
            _prModel.BADGE_NAME          = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(Model.BADGE_NAME.ToLower());
            _prModel.TITLE               = Model.TITLE;
            _prModel.EMAIL_ID            = Model.EMAIL_ID;
            _prModel.DLR_ADDRESS         = Model.DLR_ADDRESS;
            _prModel.DLR_CITY            = Model.DLR_CITY;
            _prModel.DLR_STATE           = Model.DLR_STATE;
            _prModel.DLR_ZIP             = Model.DLR_ZIP;
            _prModel.PROFILE_NOTE        = Model.PROFILE_NOTE;
            _prModel.PROFILE_TYPE        = Model.PROFILE_TYPE;
            _prModel.DIETARY_RESTRICTION = Model.DIETARY_RESTRICTION;
            _prModel.DLR_PHONE           = Model.phone1 + Model.phone2 + Model.phone3;
            _prModel.PHONE               = Model.mobile1 + Model.mobile2 + Model.mobile3;
            _prModel.BIOGRAPHY           = Model.BIOGRAPHY;
            _prModel.DEPARTMENT          = Model.DEPARTMENT;
            _prModel.SHIRT_SIZE          = Model.SHIRT_SIZE;
            _prModel.WSLX_ID             = Model.WSLX_ID;
            _prModel.UPDATED_BY          = System.Web.HttpContext.Current.Session["w_user"].ToString();
            ProfileBL  profile = new ProfileBL();
            EventBL    evBL    = new EventBL();
            EventModel evmodel = new EventModel();

            profile.UpdateProfileByStarsId(_prModel);
            evmodel            = evBL.GetEventModelByID(Model.EVENT_ID);
            Model.WSLX_ID      = String.IsNullOrWhiteSpace(Model.WSLX_ID) ? System.Web.HttpContext.Current.Session["w_user"].ToString() : Model.WSLX_ID;//removed the Session. it has to be the user that is Log
            Model.CREATED_DATE = DateTime.Now;
            Model.CREATED_BY   = System.Web.HttpContext.Current.Session["w_user"].ToString();


            RegistrationBL _regBl = new RegistrationBL();

            if (_regBl.CheckRegistrationBy(Model.STARS_ID))
            {
                Model.REGD_STATUS  = "A";
                Model.UPDATE_DATE  = DateTime.Now;
                Model.UPDATED_BY   = System.Web.HttpContext.Current.Session["w_user"].ToString();
                ViewBag.registered = 1;
                _regBl.UpdateRegistraion(Model);
            }
            else
            {
                ViewBag.registered = 1;
                _regBl.SaveRegistration(Model);
                evBL.UpdateEventCount(evmodel);

                EmailHelper.SendConfEMail(Model.EMAIL_ID);
            }



            return(RedirectToAction("Confirmation"));
        }
        public ActionResult SaveProfileUser(ProfileModel model)  
                {
             
                     ProfileBL profile =  new ProfileBL();

            if (!string.IsNullOrEmpty(model.mobile1) && !string.IsNullOrEmpty(model.mobile2) && !string.IsNullOrEmpty(model.mobile3))
            {
                if (model.mobile1.Length + model.mobile2.Length + model.mobile3.Length == 10)
                {
                    model.PHONE = model.mobile1 + model.mobile2 + model.mobile3;
                }
                else
                {
                    model.PHONE = null;
                }
            }
            else
            {
                model.PHONE   = null;
                model.mobile1 = null;
                model.mobile2 = null;
                model.mobile3 = null;
            }
            model.UPDATED_BY = System.Web.HttpContext.Current.Session["w_user"].ToString();  
                     profile.UpdateProfileByStarsId(model);  

                        return RedirectToAction("LBCProfile");
        }
        public IHttpActionResult GetVideosAndPics(NumberOfRecord <UserIdAndUserType> model)
        {
            StringBuilder traceLog = null;
            ServiceResponse <Total <List <VideoAndPicVM> > > objResponce = null;

            try
            {
                traceLog = new StringBuilder();
                traceLog.AppendLine("Start: GetVideosAndPicsRequest Data:-UserId-" + model.Param.UserId + ",UserType-" + model.Param.UserType + ",StartIndex-" + model.StartIndex + ",EndIndex-" + model.EndIndex);
                objResponce = new ServiceResponse <Total <List <VideoAndPicVM> > >();
                objResponce.IsResultTrue = true;
                objResponce.jsonData     = ProfileBL.GetVideosAndPics(model.Param.UserId, model.Param.UserType, model.StartIndex, model.EndIndex);
                return(Ok(objResponce));
            }
            catch (Exception ex)
            {
                LogManager.LogManagerInstance.WriteErrorLog(ex);
                return(BadRequest(ex.Message));
            }
            finally
            {
                traceLog.AppendLine("End:GetVideosAndPics() Response Status-" + objResponce.IsResultTrue + ",Fetched DateTime-" + DateTime.Now.ToLongDateString());
                LogManager.LogManagerInstance.WriteTraceLog(traceLog);
                traceLog = null;
            }
        }
        public IHttpActionResult PostTextMessage(ProfilePostVM <TextMessageStream> postModel)
        {
            StringBuilder traceLog = null;
            ServiceResponse <ViewPostVM> objResponse = null;

            try
            {
                traceLog = new StringBuilder();
                traceLog.AppendLine("Start: PostTextMessage() Request Data:-UserId-" + postModel.UserId + ",UserType-" + postModel.UserType + ",Stream-" + postModel.Stream + ",IsImageVideo-" + postModel.IsImageVideo);
                objResponse              = new ServiceResponse <ViewPostVM>();
                objResponse.jsonData     = ProfileBL.PostShare(postModel);
                objResponse.IsResultTrue = true;
                return(Ok(objResponse));
            }
            catch (Exception ex)
            {
                LogManager.LogManagerInstance.WriteErrorLog(ex);
                return(BadRequest(ex.Message));
            }
            finally
            {
                traceLog.AppendLine("End:PostTextMessage Response REsult Status-" + objResponse.IsResultTrue + ",Posted DateTime-" + DateTime.Now.ToLongDateString());
                LogManager.LogManagerInstance.WriteTraceLog(traceLog);
                traceLog = null;
            }
        }
示例#10
0
        public ActionResult <EditProfileResponseModel> EditProfile([FromBody] EditProfileInputModel data)
        {
            try
            {
                EditProfileResponseModel res = new EditProfileResponseModel();

                ProfileBL bl = new ProfileBL(DbContext);

                var output = bl.EditProfile(data);

                res.data     = output;
                res.Message  = "Success update data";
                res.Response = true;

                return(res);
            }
            catch (Exception ex)
            {
                EditProfileResponseModel logres = new EditProfileResponseModel();
                logres.Message  = ex.Message;
                logres.Response = false;

                return(logres);
            }
        }
示例#11
0
        private void tlbMenu_DeleteClick()
        {
            try
            {
                Cursor = Cursors.WaitCursor;
                if (XtraMessageBox.Show("Be sure to delete the record?", this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    if (!ValidarIngreso())
                    {
                        ProfileBE objE_Perfil = new ProfileBE();
                        objE_Perfil.IdProfile = int.Parse(gvPerfil.GetFocusedRowCellValue("IdProfile").ToString());
                        objE_Perfil.Login     = Parametros.strUsuarioLogin;
                        objE_Perfil.Machine   = WindowsIdentity.GetCurrent().Name.ToString();
                        objE_Perfil.IdCompany = Parametros.intEmpresaId;

                        ProfileBL objBL_Perfil = new ProfileBL();
                        objBL_Perfil.Elimina(objE_Perfil);
                        XtraMessageBox.Show("The record was successfully deleted.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        Cargar();
                    }
                }
                Cursor = Cursors.Default;
            }
            catch (Exception ex)
            {
                Cursor = Cursors.Default;
                XtraMessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        public IHttpActionResult PostComment(CommentVM model)
        {
            StringBuilder traceLog = null;
            ServiceResponse <CommentVM> objResponse = null;

            try
            {
                traceLog = new StringBuilder();
                traceLog.AppendLine("Start: PostComment() Request Data:-PostId-" + model.PostId + ",UserName" + model.UserName + ",UserId-" + model.UserId + ",Message-" + model.Message);
                objResponse              = new ServiceResponse <CommentVM>();
                objResponse.jsonData     = ProfileBL.PostComment(model);
                objResponse.IsResultTrue = true;
                return(Ok(objResponse));
            }
            catch (Exception ex)
            {
                LogManager.LogManagerInstance.WriteErrorLog(ex);
                return(BadRequest(ex.Message));
            }
            finally
            {
                traceLog.AppendLine("End:PostComment() Response Result status-" + objResponse.IsResultTrue + ",Posted DateTime-" + DateTime.Now.ToLongDateString());
                LogManager.LogManagerInstance.WriteTraceLog(traceLog);
                traceLog = null;
            }
        }
        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));
        }
示例#14
0
        public ActionResult Monitor()
        {
            ProfileBL bl = new ProfileBL();

            List <CoreProfile> profiles = bl.GetProfileList();

            return(View(profiles));
        }
示例#15
0
        public ActionResult Profiles()
        {
            ProfileBL bl = new ProfileBL();

            List <CoreProfile> profiles = bl.GetProfileList();

            return(View("Profiles", profiles));
        }
        private void Delete_Purchase_Button_Click(object sender, EventArgs e)
        {
            profile = serializer.Deserialize("Test_user.xml");
            ProfileBL profileBL = new ProfileBL(profile);

            profileBL.DeleteSpendByIndex(indexOfElement);

            serializer.Serialize(profile, "Test_user.xml");

            Navigation.PushAsync(new HistoryOfPurchases());
        }
示例#17
0
        void ExportarExcel(string filename)
        {
            Excel._Application xlApp;
            Excel._Workbook    xlLibro;
            Excel._Worksheet   xlHoja;
            Excel.Sheets       xlHojas;
            xlApp    = new Excel.Application();
            filename = Path.Combine(Directory.GetCurrentDirectory(), "Excel\\Profile.xlsx");
            xlLibro  = xlApp.Workbooks.Open(filename, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value);
            xlHojas  = xlLibro.Sheets;
            xlHoja   = (Excel._Worksheet)xlHojas[1];

            Cursor.Current = Cursors.WaitCursor;

            try
            {
                int Row       = 6;
                int Secuencia = 1;

                List <ProfileBE> lstProfile = null;
                lstProfile = new ProfileBL().ListaTodosActivo();
                if (lstProfile.Count > 0)
                {
                    xlHoja.Shapes.AddPicture(Path.Combine(Directory.GetCurrentDirectory(), "Logo.jpg"), Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoCTrue, 1, 1, 100, 60);

                    foreach (var item in lstProfile)
                    {
                        xlHoja.Cells[Row, 1] = item.IdProfile;
                        xlHoja.Cells[Row, 2] = item.NameProfile;

                        Row       = Row + 1;
                        Secuencia = Secuencia + 1;
                    }
                }

                xlLibro.SaveAs("C:\\Excel\\Profile.xlsx", Excel.XlFileFormat.xlWorkbookDefault, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Excel.XlSaveAsAccessMode.xlExclusive, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value);

                xlLibro.Close(true, Missing.Value, Missing.Value);
                xlApp.Quit();

                Cursor.Current = Cursors.Default;
                BSUtils.OpenExcel("C:\\Excel\\Profile.xlsx");
                //XtraMessageBox.Show("It was imported correctly \n The file was generated C:\\Excel\\Profile.xlsx", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                xlLibro.Close(false, Missing.Value, Missing.Value);
                xlApp.Quit();
                Cursor.Current = Cursors.Default;
                MessageBox.Show(ex.Message, ex.Source, MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
示例#18
0
        public JsonResult StartConsumer(FormCollection collection)
        {
            List <Contain> tasklist = HttpContext.Application["TaskList"] as List <Contain>;

            if (tasklist != null)
            {
                string key  = collection["key"];
                string pkey = collection["pkey"];

                ProfileBL   pbl     = new ProfileBL();
                CoreProfile profile = pbl.GetProfile(pkey);

                switch (key)
                {
                case "system":
                    for (int i = 0; i < profile.SystemConsumerNum; i++)
                    {
                        CreateConsumer("mq_system_" + profile.ProjectKey, profile.MQServer, profile.ProjectKey, i, new EventHandler <BasicDeliverEventArgs>(new TrackLogBL(SendHeartData).ResolveSystem));
                    }
                    break;

                case "operate":
                    for (int i = 0; i < profile.OperateConsumerNum; i++)
                    {
                        CreateConsumer("mq_operate_" + profile.ProjectKey, profile.MQServer, profile.ProjectKey, i, new EventHandler <BasicDeliverEventArgs>(new TrackLogBL(SendHeartData).ResolveOperate));
                    }
                    break;

                case "exception":
                    for (int i = 0; i < profile.ExceptionConsumerNum; i++)
                    {
                        CreateConsumer("mq_exception_" + profile.ProjectKey, profile.MQServer, profile.ProjectKey, i, new EventHandler <BasicDeliverEventArgs>(new TrackLogBL(SendHeartData).ResolveException));
                    }
                    break;

                case "normal":
                    for (int i = 0; i < profile.NormalConsumerNum; i++)
                    {
                        CreateConsumer("mq_normal_" + profile.ProjectKey, profile.MQServer, profile.ProjectKey, i, new EventHandler <BasicDeliverEventArgs>(new TrackLogBL(SendHeartData).ResolveNormal));
                    }
                    break;
                }
            }

            return(Json(new ResultDTO()
            {
                Status = "Success",
                Message = "",
                Data = ""
            }));
            //
        }
示例#19
0
        public ActionResult SaveProfileWslxId(ProfileModel model)
        {
            ProfileBL _profile = new ProfileBL();

            if (_profile.UpdateProfileWslxIdByStarsId(model))
            {
                return(RedirectToAction("Welcome", "LBC"));
            }
            else
            {
                return(RedirectToAction("NoAuthorized", "HttpErrors"));
            }
        }
示例#20
0
        // GET: Core/Edit/5
        public ActionResult Edit(string key)
        {
            CoreProfile profile = null;

            if (!string.IsNullOrEmpty(key))
            {
                ProfileBL bl = new ProfileBL();

                profile = bl.GetProfile(key);
            }

            return(View("ProfileDetail", profile));
        }
示例#21
0
        public ActionResult PrintStory(int id)
        {
            StoryBL    _storybl = new StoryBL();
            StoryModel _story   = new StoryModel();

            _story = _storybl.getStoriesBySEQID(id);

            ProfileModel pModel = new ProfileBL().GetProfileByStarzId(Session["StarsIdProfile"].ToString());

            _story.Profile = pModel;

            return(this.ViewPdfLandscape(" ", "PrintStory", _story));
        }
        public IHttpActionResult UpdateProfilePic(ProfilePicStreamVM model)
        {
            StringBuilder traceLog = null;
            ServiceResponse <MessageVM> objResponse = null;

            try
            {
                traceLog = new StringBuilder();
                traceLog.AppendLine("Start: UpdateProfilePic() Request Data:-PicBase64String-" + model.PicBase64String + ",PicName-" + model.PicName + ",PicExtension-" + model.PicExtension);
                objResponse = new ServiceResponse <MessageVM>();
                string root    = HttpContext.Current.Server.MapPath("~/images/result");
                var    bytes   = Convert.FromBase64String(model.PicBase64String);
                string picName = Guid.NewGuid().ToString() + ConstantHelper.constUnderscore + model.PicName + "." + model.PicExtension;
                using (var imageFile = new FileStream(root + ConstantHelper.constDoubleBackSlash + picName, FileMode.Create))
                {
                    imageFile.Write(bytes, 0, bytes.Length);
                    imageFile.Flush();
                }
                model.PicName = picName;
                bool flag = ProfileBL.UpdateProfilePic(model.UserId, model.UserType, picName);
                if (flag)
                {
                    objResponse = new ServiceResponse <MessageVM>()
                    {
                        IsResultTrue = true, jsonData = new MessageVM()
                        {
                            Message = Message.PhotoUploadedSuccess
                        }
                    };
                }
                else
                {
                    objResponse = new ServiceResponse <MessageVM>()
                    {
                        IsResultTrue = false, ErrorMessage = Message.ServerError
                    };
                }
                return(Ok(objResponse));
            }
            catch (System.Exception e)
            {
                LogManager.LogManagerInstance.WriteErrorLog(e);
                return(InternalServerError());
            }
            finally
            {
                traceLog.AppendLine("End:UpdateProfilePic() Response Result Status-" + objResponse.IsResultTrue + ",ErrorMessage-" + objResponse.ErrorMessage + ",Updated DateTime-" + DateTime.Now.ToLongDateString());
                LogManager.LogManagerInstance.WriteTraceLog(traceLog);
                traceLog = null;
            }
        }
示例#23
0
        // POST: Core/Delete/5

        public ActionResult Delete(string key)
        {
            ProfileBL bl = new ProfileBL();

            CoreProfile profile = bl.GetProfile(key);

            StopConsumer(profile.ProjectKey, null);

            bl.RemoveProfile(key);


            List <CoreProfile> profiles = bl.GetProfileList();

            return(View("Profiles", profiles));
        }
示例#24
0
        public ActionResult Index()
        {
            IOwinContext        ctx    = Request.GetOwinContext();
            ClaimsPrincipal     user   = ctx.Authentication.User;
            IEnumerable <Claim> claims = user.Claims;
            //获取Cliams的方式
            //1、user.FindFirst("WatcherUser").Value
            //2、use Linq to claims

            ProfileBL bl = new ProfileBL();

            List <CoreProfile> profiles = bl.GetProfileList();


            return(View(profiles));
        }
            public MarketListProvider(string defaultText = null)
            {
                if (!string.IsNullOrEmpty(defaultText))
                {
                    Add(string.Empty, defaultText);
                }

                ProfileBL _profile = new ProfileBL();

                List <string> lst = _profile.GetMarketList();

                Add("ALL", "MARKET");
                for (int i = 0; i < lst.Count; i++)
                {
                    Add(lst[i], lst[i]);
                }
            }
示例#26
0
        public void SerializeDefault()
        {
            Profile   profile   = new Profile();
            ProfileBL profileBL = new ProfileBL(profile);

            profileBL.CreateDefaultProfile("Test");

            var path     = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
            var filename = Path.Combine(path, "Test_user.xml");

            XmlSerializer xmlSerializer = new XmlSerializer(typeof(Profile));

            using (FileStream fs = new FileStream(filename, FileMode.OpenOrCreate))
            {
                xmlSerializer.Serialize(fs, profile);
            }
        }
        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"));
        }
示例#28
0
        public JsonResult RemoveConsumer(FormCollection collection)
        {
            string profileKey = collection["pkey"];
            string key        = collection["key"];

            ProfileBL   bl      = new ProfileBL();
            CoreProfile profile = bl.GetProfile(profileKey);

            StopConsumer(profile.ProjectKey, key);


            return(Json(new ResultDTO()
            {
                Status = "Success",
                Message = "",
                Data = ""
            }, JsonRequestBehavior.AllowGet));
        }
        public IHttpActionResult ProfileDetails(ProfileDetailVM model)
        {
            StringBuilder traceLog = null;
            ServiceResponse <UserProfileVM> objUserDetailResponse    = null;
            ServiceResponse <TrainerViewVM> objTrainerDetailResponse = null;
            bool isJonedTeam = false;

            try
            {
                traceLog = new StringBuilder();
                traceLog.AppendLine("Start: ProfileDetails() Request Data:-UserId-" + model.UserId + ",UserType-" + model.UserType);
                if (model.UserType.Equals(Message.UserTypeUser, StringComparison.OrdinalIgnoreCase))
                {
                    objUserDetailResponse              = new ServiceResponse <UserProfileVM>();
                    objUserDetailResponse.jsonData     = ProfileBL.GetUserProfileDetails(model.UserId, ref isJonedTeam, model.UserNotificationID);
                    objUserDetailResponse.IsResultTrue = true;
                    traceLog.AppendLine("Response Status Result Ststus-" + objUserDetailResponse.IsResultTrue);
                    return(Ok(objUserDetailResponse));
                }
                else if (model.UserType.Equals(Message.UserTypeTrainer, StringComparison.OrdinalIgnoreCase))
                {
                    objTrainerDetailResponse              = new ServiceResponse <TrainerViewVM>();
                    objTrainerDetailResponse.jsonData     = ProfileBL.GetTrainerProfileDetails(model.UserId, ref isJonedTeam, model.UserNotificationID);
                    objTrainerDetailResponse.IsResultTrue = true;
                    traceLog.AppendLine("Response Status Result Ststus-" + objTrainerDetailResponse.IsResultTrue);
                    return(Ok(objTrainerDetailResponse));
                }
                return(BadRequest(ModelState));
            }
            catch (Exception ex)
            {
                LogManager.LogManagerInstance.WriteErrorLog(ex);
                return(BadRequest(ex.Message));
            }
            finally
            {
                traceLog.AppendLine("End:ProfileDetails() Updated DateTime-" + DateTime.Now.ToLongDateString());
                LogManager.LogManagerInstance.WriteTraceLog(traceLog);
                traceLog = null;
            }
        }
        private void Add_Purchase_Button_Click(object sender, EventArgs e)
        {
            Serializer serializer = new Serializer();

            Spend spend = new Spend
            {
                Name        = nameOfPruchase.Text,
                Category    = categoryPicker.Items[categoryPicker.SelectedIndex],
                Description = description.Text,
                Amount      = double.Parse(amount.Text)
            };

            profile = serializer.Deserialize("Test_user.xml");
            ProfileBL profileBL = new ProfileBL(profile);

            profileBL.AddSpend(spend);

            serializer.Serialize(profile, "Test_user.xml");

            Navigation.PushAsync(new HistoryOfPurchases());
        }
        public DataResultUserCreateResult CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, string activateFormVirtualPath)
        {
            DataResultUserCreateResult result;
            EmailAttribute emailDataAnnotations = new EmailAttribute();
            if (!emailDataAnnotations.IsValid(email))
            {
                //result = new DataResultUserCreateResult(new CreatedAccountResultModel(MembershipCreateStatus.InvalidEmail));
                result = new DataResultUserCreateResult()
                {
                    IsValid = true,
                    MessageType = DataResultMessageType.Error,
                    Data = new CreatedAccountResultModel(MembershipCreateStatus.InvalidEmail)
                };
            }
            else
            {
                if (this.ValidatePasswordStrength(password))
                {

                    using (TransactionScope trans = this.TransactionScopeCreate())
                    {
                        result = this._dal.CreateUser(username, password, email, passwordQuestion, passwordAnswer, activateFormVirtualPath);

                        if (result.Data.CreateStatus == MembershipCreateStatus.Success)
                        {
                            MembershipUserWrapper newUser = _dal.GetUserByName(username, false).Data;

                            IRoleAdminBL _roleBl = new RoleAdminBL();
                            DataResultBoolean newUserRole = _roleBl.AddToRoles(newUser.UserName, new string[1] { SiteRoles.Guest.ToString() });
                            _roleBl.Dispose();

                            ProfileBL _profileBL = new ProfileBL();
                            UserProfileModel usrProfile = _profileBL.Create(username).Data;
                            _profileBL.Dispose();

                            ITokenTemporaryPersistenceBL<MembershipUserWrapper> _tokenServices = new TokenTemporaryPersistenceBL<MembershipUserWrapper>();
                            TokenTemporaryPersistenceServiceItem<MembershipUserWrapper> token = new TokenTemporaryPersistenceServiceItem<MembershipUserWrapper>(newUser);
                            _tokenServices.Insert(token);
                            result.Data.ActivateUserToken = token.Token;
                            _tokenServices.Dispose();

                            if (newUserRole.Data)
                            {
                                MailMessage mail = new MailMessage();
                                mail.From = new MailAddress(ApplicationConfiguration.MailingSettingsSection.SupportTeamEmailAddress);
                                mail.Bcc.Add(new MailAddress(newUser.Email));
                                mail.Subject = string.Format(AccountResources.CreateNewAccount_EmailSubject, ApplicationConfiguration.DomainInfoSettingsSection.DomainName);
                                mail.Body = string.Format(AccountResources.CreateNewAccount_EmailBody,
                                                                            ApplicationConfiguration.DomainInfoSettingsSection.DomainName,
                                                                            new Uri(string.Format("{0}://{1}{2}/{3}",
                                                                                                                    ApplicationConfiguration.DomainInfoSettingsSection.SecurityProtocol,
                                                                                                                    ApplicationConfiguration.DomainInfoSettingsSection.DomainName,
                                                                                                                    activateFormVirtualPath.ToString(),
                                                                                                                    result.Data.ActivateUserToken)));

                                using (ISmtpClient smtp = DependencyFactory.Resolve<ISmtpClient>())
                                {
                                    smtp.Send(mail);
                                }

                                trans.Complete();
                            }
                            else
                            {
                                trans.Dispose();
                            }
                        }
                        else
                        {
                            trans.Dispose();
                        }
                    }
                }
                else
                {
                    result = new DataResultUserCreateResult()
                    {
                        IsValid = true,
                        MessageType = DataResultMessageType.Error,
                        Data = new CreatedAccountResultModel(MembershipCreateStatus.InvalidPassword)
                    };

                }
            }
            return result;
        }
 public ProfileService()
 {
     this._bl = new ProfileBL();
 }