Пример #1
0
 public void CreateTest()
 {
     o = ProfileObjectFactory.Create(id, name, location, gender,
                                     birthDay, occupation, aboutText, profileImage);
     validateResults(id, name, location, gender, birthDay,
                     occupation, aboutText, profileImage);
 }
Пример #2
0
        public static ProfileViewModel Create(ProfileObject o)
        {
            var v = new ProfileViewModel
            {
                Name         = o?.DbRecord.Name,
                ID           = o?.DbRecord.ID,
                Location     = o?.DbRecord.Location,
                Gender       = o.DbRecord.Gender,
                BirthDay     = o.DbRecord.BirthDay,
                AboutText    = o?.DbRecord.AboutText,
                Occupation   = o?.DbRecord.Occupation,
                ProfileImage = o?.DbRecord.ProfileImage
            };

            if (o is null)
            {
                return(v);
            }
            foreach (var p in o.ProfilesInUse)
            {
                var profile = ProfileViewModelFactory.Create(p);
                v.InProfiles.Add(profile);
            }
            return(v);
        }
        private void AddProfile()
        {
            var addNoteViewModel = new AddEditNoteViewModel();

            addNoteViewModel.OnSaveAction = () =>
            {
                var profile = new ProfileObject
                {
                    Name = addNoteViewModel.Name,
                };

                profiles.Add(profile);

                SelectedProfile = profile;

                NoteService.SaveAppSettings();

                eventAggregator.GetEvent <RefreshSettingsEvent>().Publish(new RefreshSettingsEventArgs());
            };

            var popupEventArgs = new RaisePopupEventArgs()
            {
                Title   = CommonResourceManager.Instance.GetResourceString("XRay_AddEditNoteView_AddProfileTitle"),
                Content = new AddEditNoteView(addNoteViewModel)
            };

            eventAggregator.GetEvent <RaisePopupEvent>().Publish(popupEventArgs);
        }
Пример #4
0
 public FollowingObject(FollowingDbRecord dbRecord) : base(dbRecord)
 {
     DbRecord.UserProfile         = DbRecord.UserProfile ?? new ProfileDbRecord();
     DbRecord.FollowedUserProfile = DbRecord.FollowedUserProfile ?? new ProfileDbRecord();
     UserObject         = new ProfileObject(DbRecord.UserProfile);
     FollowedUserObject = new ProfileObject(DbRecord.FollowedUserProfile);
 }
Пример #5
0
        public static void WriteToNod(ProfileObject obj)
        {
            Document     doc   = Application.DocumentManager.MdiActiveDocument;
            Database     db    = doc.Database;
            Editor       ed    = doc.Editor;
            Transaction  trans = doc.TransactionManager.StartTransaction();
            DBDictionary dBDictionary;

            using (trans)
            {
                DBDictionary nod = (DBDictionary)trans.GetObject(db.NamedObjectsDictionaryId,
                                                                 OpenMode.ForRead);

                //try to add new dictonary to the NOD if it fails then create a new one
                try
                {
                    ObjectId appDictionaryId = nod.GetAt(APPDICTIONARYNAME);
                    //if we are here no error so dictionary already exist
                    dBDictionary = (DBDictionary)trans.GetObject(appDictionaryId, OpenMode.ForRead);
                }
                catch
                {
                    ed.WriteMessage(APPDICTIONARYNAME + " App Dictionary does not exist ");
                    return;
                }

                if (!dBDictionary.IsWriteEnabled)
                {
                    dBDictionary.UpgradeOpen();
                }

                //create new Xrecord
                Xrecord xrecord = new Xrecord();
                //create the resbuf list
                ResultBuffer data = new ResultBuffer(new TypedValue((int)DxfCode.Text, obj.NodKey),
                                                     new TypedValue((int)DxfCode.Int64, obj.DistanceAtCrossing),
                                                     new TypedValue((int)DxfCode.Text, obj.Layer),
                                                     new TypedValue((int)DxfCode.Text, obj.LineType),
                                                     new TypedValue((int)DxfCode.Int32, obj.Depth));
                //add data to new record
                xrecord.Data = data;

                //create the entry to nod
                dBDictionary.SetAt(obj.NodKey, xrecord);

                try
                {
                    //add to transaction, if exist then handle in catch
                    trans.AddNewlyCreatedDBObject(xrecord, true);
                }
                catch
                {
                    //what todo when xrecord already exists
                }

                //all ok then commit
                trans.Commit();
            }
        }
Пример #6
0
        public CommentProfileObject(CommentProfileDbRecord dbRecord) : base(dbRecord)
        {
            DbRecord.Comments = DbRecord.Comments ?? new CommentDbRecord();
            DbRecord.Profiles = DbRecord.Profiles ?? new ProfileDbRecord();

            CommentObject = new CommentObject(DbRecord.Comments);
            ProfileObject = new ProfileObject(DbRecord.Profiles);
        }
Пример #7
0
        public AttendingObject(AttendingDbRecord dbRecord) : base(dbRecord)
        {
            DbRecord.Events   = DbRecord.Events ?? new EventDbRecord();
            DbRecord.Profiles = DbRecord.Profiles ?? new ProfileDbRecord();

            EventObject   = new EventObject(DbRecord.Events);
            ProfileObject = new ProfileObject(DbRecord.Profiles);
        }
Пример #8
0
 private void BtnEditProfile_Click(object sender, RoutedEventArgs e)
 {
     if (this.listProfiles.SelectedItems.Count == 1)
     {
         ProfileObject profile = (ProfileObject)this.listProfiles.SelectedItems[0];
         new ProfileWindow((Window)Global.MAIN_WINDOW, profile).ShowDialog();
     }
 }
Пример #9
0
 public ProfileWindow(Window owner, ProfileObject profile)
 {
     Class7.RIuqtBYzWxthF();
     this.InitializeComponent();
     base.Owner      = owner;
     this._operation = Global.FormOperation.update;
     this._profile   = profile;
 }
Пример #10
0
        private AuthenticationLevel LoginToIndividualSource(string sourceAlias, string username, string password)
        {
            AuthenticationLevel ret = AuthenticationLevel.None;

            try
            {
                string          wsId     = m_SysConfig.GetDefaultConfig().WorkstationAlias;
                UserInfo        userInfo = new UserInfo(username, password);
                WorkstationInfo wsInfo   = new WorkstationInfo(wsId, userInfo);

                LoginResponse loginResponse = m_DataSourceAccess.Login(sourceAlias, wsInfo);

                ret = loginResponse.UserAuthenticationLevel;

                if (!ret.Equals(AuthenticationLevel.None))
                {
                    SysConfiguration sysConfig = new SysConfiguration();
                    sysConfig.ID = sourceAlias;
                    sysConfig.ContainerDBConnectionString = loginResponse.systemConfiguration.ContainerDBConnectString;
                    sysConfig.ContainerRefreshPeriodmsecs = loginResponse.systemConfiguration.ContainerRefreshPeriodSeconds * 1000;

                    if (m_SysConfig.Contains(sourceAlias))
                    {
                        m_SysConfig.Delete(sourceAlias);
                    }

                    m_SysConfig.Add(sysConfig);

                    if (m_SysConfig.UserProfileManager.Profile == null)
                    {
                        ProfileObject profile = ProfileTranslator.Translate(loginResponse.UserProfile, 4);
                        profile.SourceAlias = sourceAlias;
                        profile.UserName    = wsInfo.userInfo.UserName;
                        profile.Password    = wsInfo.userInfo.Password;

                        m_SysConfig.UserProfileManager.Profile = profile;
                        m_SysConfig.UserProfileManager.Profile.ProfileUpdatedEvent += new ProfileUpdated(ProfileUpdated);
                    }

                    DataSet caselist = null;
                    m_DataSourceAccess.GetCaseList(sourceAlias, out caselist);

                    if (caselist != null)
                    {
                        CaseListDataSet caseListDataSet = (CaseListDataSet)caselist;
                        caseListDataSet.CaseListTable.CaseListTableRowChanged +=
                            new CaseListDataSet.CaseListTableRowChangeEventHandler(CaseListTable_CaseListTableRowChanged);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(ret);
        }
Пример #11
0
        public void Initialize(Object passedObj)
        {
            FilterParameter filterParam = passedObj as FilterParameter;

            if (filterParam != null)
            {
                dockPanel = filterParam.dockPanel;
                Width     = filterParam.Width;
                Height    = filterParam.Height;
                m_History = filterParam.History;
                if (filterParam.SysConfig != null)
                {
                    m_defaultDensityDefaultValue  = filterParam.SysConfig.DensityAlarmDefaultValue;
                    m_defaultDensitySetOnCaseOpen = filterParam.SysConfig.DensityAlarmSetOnCaseOpen;
                    m_profile = filterParam.SysConfig.Profile;
                }
                else
                {
                    m_defaultDensityDefaultValue  = 0.0;
                    m_defaultDensitySetOnCaseOpen = false;
                }


                HistoryFilter filter = new HistoryFilter();
                filter.name = m_Name;
                if (m_defaultDensitySetOnCaseOpen)
                {
                    if (m_profile != null && m_profile.DensityAlarmValue != 0.0)
                    {
                        filter.parameter = m_profile.DensityAlarmValue.ToString();
                    }
                    else
                    {
                        filter.parameter = m_defaultDensityDefaultValue.ToString();
                    }
                }
                else
                {
                    filter.parameter = "0.0";
                }
                m_History.SetFirstStep(filter);

                m_ValueSlider.IsEnabled = false;
                if (m_profile != null && m_profile.DensityAlarmValue != 0.0)
                {
                    m_ValueSlider.Value = m_profile.DensityAlarmValue * 100.0;
                }
                else
                {
                    m_ValueSlider.Value = m_defaultDensityDefaultValue * 100.0;
                }
                m_ValueSlider.IsEnabled = true;

                m_ValTextBox.Text = (m_ValueSlider.Value).ToString("F0") + " %";
            }
        }
Пример #12
0
        internal void ProfileUpdated()
        {
            ProfileObject profileObj = m_SysConfig.UserProfileManager.Profile;

            if (profileObj != null)
            {
                Profile profile = ProfileTranslator.Translate(profileObj);
                m_DataSourceAccess.UpdateProfile(profileObj.SourceAlias, profileObj.UserName, profile);
            }
        }
Пример #13
0
 private void BtnDuplicateProfile_Click(object sender, RoutedEventArgs e)
 {
     if (this.listProfiles.SelectedItems.Count > 0)
     {
         foreach (ProfileObject obj2 in this.listProfiles.SelectedItems)
         {
             ProfileObject item = new ProfileObject {
                 Id   = Guid.NewGuid().ToString(),
                 No   = Global.SETTINGS.PROFILES.Count + 1,
                 Name = obj2.Name,
                 SameBillingShipping = obj2.SameBillingShipping,
                 OnePerWebsite       = obj2.OnePerWebsite,
                 FirstName           = obj2.FirstName,
                 LastName            = obj2.LastName,
                 Address1            = obj2.Address1,
                 Address2            = obj2.Address2,
                 City              = obj2.City,
                 Zip               = obj2.Zip,
                 State             = obj2.State,
                 StateId           = obj2.StateId,
                 CountryId         = obj2.CountryId,
                 Phone             = obj2.Phone,
                 Email             = obj2.Email,
                 FirstNameShipping = obj2.FirstNameShipping,
                 LastNameShipping  = obj2.LastNameShipping,
                 Address1Shipping  = obj2.Address1Shipping,
                 Address2Shipping  = obj2.Address2Shipping,
                 CityShipping      = obj2.CityShipping,
                 ZipShipping       = obj2.ZipShipping,
                 EmailShipping     = obj2.EmailShipping,
                 PhoneShipping     = obj2.PhoneShipping,
                 StateIdShipping   = obj2.StateIdShipping,
                 StateShipping     = obj2.StateShipping,
                 CountryIdShipping = obj2.CountryIdShipping,
                 NameOnCard        = obj2.NameOnCard,
                 CardTypeId        = obj2.CardTypeId,
                 CCNumber          = obj2.CCNumber,
                 Cvv               = obj2.Cvv,
                 ExpiryMonth       = obj2.ExpiryMonth,
                 ExpiryYear        = obj2.ExpiryYear,
                 Privacy           = obj2.Privacy,
                 PrivacyCardName   = obj2.PrivacyCardName,
                 BirthdayDay       = obj2.BirthdayDay,
                 BirthdayMonth     = obj2.BirthdayMonth,
                 BirthdayYear      = obj2.BirthdayYear,
                 IdGroup           = obj2.IdGroup,
                 VariousBilling    = obj2.VariousBilling,
                 VariousShipping   = obj2.VariousShipping
             };
             Global.SETTINGS.PROFILES.Add(item);
         }
         Helpers.SaveSettings();
     }
 }
Пример #14
0
        public ProfileObject GetPlayerInfo(string urlOptionalPart)
        {
            ProfileObject profile        = new ProfileObject();
            Task <HttpResponseMessage> t = _client.GetAsync(_client.BaseAddress + "players/" + urlOptionalPart);

            if (t.Result.IsSuccessStatusCode)
            {
                string result = t.Result.Content.ReadAsStringAsync().Result;
                profile = JsonConvert.DeserializeObject <ProfileObject>(result);
            }
            return(profile);
        }
Пример #15
0
        public ProfileWindow(Window owner)
        {
            Class7.RIuqtBYzWxthF();
            this.InitializeComponent();
            base.Owner      = owner;
            this._operation = Global.FormOperation.insert;
            ProfileObject obj1 = new ProfileObject {
                Id = Guid.NewGuid().ToString(),
                No = Global.SETTINGS.PROFILES.Count + 1
            };

            this._profile = obj1;
        }
Пример #16
0
        public static FollowingObject Create(ProfileObject userProfileObject, ProfileObject followedUserProfileObject,
                                             string userID, string followedUserID)
        {
            var o = new FollowingDbRecord
            {
                FollowedUserID      = followedUserID,
                UserID              = userID,
                UserProfile         = userProfileObject?.DbRecord ?? new ProfileDbRecord(),
                FollowedUserProfile = followedUserProfileObject?.DbRecord ?? new ProfileDbRecord()
            };

            o.UserID         = o.UserProfile.ID;
            o.FollowedUserID = o.FollowedUserProfile.ID;
            return(new FollowingObject(o));
        }
Пример #17
0
        /// <summary>
        /// displays a persons profile page
        /// </summary>
        /// <param name="email"></param>
        /// <returns></returns>
        public ActionResult PersonProfile(string email)
        {
            email         = User.Identity.Name;
            ViewBag.Title = "Your Profile";
            var profile = new ProfileObject
            {
                Activities = _activityManager.RetrieveActivitiesByPersonID(_userManager.RetrieveUserIDFromEmail(email)),
                Groups     = _userManager.RetrievePersonGroups(_userManager.RetrieveUserIDFromEmail(email)),
                Person     = _userManager.RetrieveUserByID(_userManager.RetrieveUserIDFromEmail(email))
            };

            profile.Person.Roles = _userManager.RetrievePersonRoles(_userManager.RetrieveUserIDFromEmail(email));

            return(View(profile));
        }
Пример #18
0
        public static AttendingObject Create(EventObject eventObject, ProfileObject profileObject,
                                             string eventID, string userID)
        {
            var o = new AttendingDbRecord
            {
                EventID   = eventID,
                ProfileID = userID,
                Events    = eventObject?.DbRecord ?? new EventDbRecord(),
                Profiles  = profileObject?.DbRecord ?? new ProfileDbRecord()
            };

            o.EventID   = o.Events.ID;
            o.ProfileID = o.Profiles.ID;
            return(new AttendingObject(o));
        }
Пример #19
0
        public static CommentProfileObject Create(CommentObject commentObject, ProfileObject profileObject,
                                                  string commentID, string userID)
        {
            var o = new CommentProfileDbRecord
            {
                CommentID = commentID,
                ProfileID = userID,
                Comments  = commentObject?.DbRecord ?? new CommentDbRecord(),
                Profiles  = profileObject?.DbRecord ?? new ProfileDbRecord()
            };

            o.CommentID = o.Comments.ID;
            o.ProfileID = o.Profiles.ID;
            return(new CommentProfileObject(o));
        }
Пример #20
0
        public async Task LoadEvents(ProfileObject profileObject)
        {
            if (profileObject is null)
            {
                return;
            }
            var userID = profileObject.DbRecord.ID ?? string.Empty;
            var events = await dbSet.Include(x => x.Events).
                         Where(x => x.ProfileID == userID).AsNoTracking()
                         .ToListAsync();

            foreach (var e in events)
            {
                profileObject.UsedInEvent(new EventObject(e.Events));
            }
        }
Пример #21
0
 public void ProfileInUse(ProfileObject profileObject)
 {
     if (profileObject is null)
     {
         return;
     }
     if (profileObject.DbRecord.ID == Constants.Unspecified)
     {
         return;
     }
     if (profilesInUse.Find(x => x.DbRecord.ID == profileObject.DbRecord.ID) != null)
     {
         return;
     }
     profilesInUse.Add(profileObject);
 }
Пример #22
0
        public void CreateTest()
        {
            var    r          = GetRandom.Object <AttendingDbRecord>();
            var    newEvent   = new EventObject(r.Events);
            var    newProfile = new ProfileObject(r.Profiles);
            string e          = Constants.Unspecified;
            string p          = Constants.Unspecified;

            var o = AttendingObjectFactory.Create(newEvent, newProfile, e, p);

            Assert.AreEqual(o.EventObject.DbRecord, r.Events);
            Assert.AreEqual(o.ProfileObject.DbRecord, r.Profiles);
            Assert.AreEqual(o.DbRecord.EventID, r.Events.ID);
            Assert.AreEqual(o.DbRecord.ProfileID, r.Profiles.ID);
            Assert.AreEqual(o.DbRecord.Events, r.Events);
            Assert.AreEqual(o.DbRecord.Profiles, r.Profiles);
        }
        public void CreateTest()
        {
            var    r          = GetRandom.Object <CommentProfileDbRecord>();
            var    newComment = new CommentObject(r.Comments);
            var    newProfile = new ProfileObject(r.Profiles);
            string c          = Constants.Unspecified;
            string p          = Constants.Unspecified;

            var o = CommentProfileObjectFactory.Create(newComment, newProfile,
                                                       c, p);

            Assert.AreEqual(o.CommentObject.DbRecord, r.Comments);
            Assert.AreEqual(o.ProfileObject.DbRecord, r.Profiles);
            Assert.AreEqual(o.DbRecord.CommentID, r.Comments.ID);
            Assert.AreEqual(o.DbRecord.ProfileID, r.Profiles.ID);
            Assert.AreEqual(o.DbRecord.Profiles, r.Profiles);
            Assert.AreEqual(o.DbRecord.Comments, r.Comments);
        }
Пример #24
0
        public ActionResult UserName(string id)
        {
            var p = db.Database.SqlQuery<Professor>(professorquery + " where (Links.UserName = '******') ");
            var t = db.Database.SqlQuery<TermStatus>(termstatusquery + " where (Links.UserName = '******') ");
            var w = db.Database.SqlQuery<WorkStatus>(workstatusquery + " where (Links.UserName = '******') ");
            var d = db.Database.SqlQuery<Designation>(designationquery + " where (Links.UserName = '******') ");
            var teach = db.Database.SqlQuery<Teaching>(teachingquery + " where (Links.UserName = '******') ");
            var course = db.Database.SqlQuery<Course>(coursequery + " where (Links.UserName = '******') ");

            ProfileObject profile = new ProfileObject();
            profile.professor = p != null && p.Any() ? p.First<Professor>() : null;
            profile.termstatus = t != null && t.Any() ? t.First<TermStatus>() : null;
            profile.workstatus = w != null && w.Any() ? w.First<WorkStatus>() : null;
            profile.designation = d != null && d.Any() ? d.First<Designation>() : null;
            profile.teachings = teach.ToList();
            profile.courses = course.ToList();
            profile.UserName = id;
            return View(profile);
        }
Пример #25
0
 private void BtnDeleteProfile_Click(object sender, RoutedEventArgs e)
 {
     if (this.listProfiles.SelectedItems.Count > 0)
     {
         if (MessageBox.Show("Really delete the selected profiles?", "Are you sure?", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
         {
             List <string> list = new List <string>();
             foreach (ProfileObject obj2 in this.listProfiles.SelectedItems)
             {
                 list.Add(obj2.Id);
             }
             foreach (string id in list)
             {
                 ProfileObject item = Global.SETTINGS.PROFILES.First <ProfileObject>(x => x.Id == id);
                 Global.SETTINGS.PROFILES.Remove(item);
             }
         }
         Helpers.SaveSettings();
     }
 }
Пример #26
0
        public void DrawProfileObjects(ProfileObject obj)
        {
            Transaction trans = database.TransactionManager.StartTransaction();

            using (trans)
            {
                BlockTable       bt  = trans.GetObject(database.BlockTableId, OpenMode.ForRead) as BlockTable;
                BlockTableRecord btr = trans.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite) as BlockTableRecord;

                Vector3d normal        = Vector3d.ZAxis;
                Vector3d majorAxis     = (obj.Size * 2) * Vector3d.YAxis;              //2 need to be change to a vertical scale variable / by 2!!!!
                double   radiusRatio   = .25;
                double   startingAngle = 0.0;
                double   endAng        = 0.0;

                Ellipse ellipse = new Ellipse(
                    obj.Center,
                    normal,
                    majorAxis,
                    radiusRatio,
                    startingAngle,
                    endAng
                    );

                DBText dBText = new DBText();
                dBText.Layer      = "TEXT-2";
                dBText.Height     = 2.2;
                dBText.TextString = obj.Contents;

                Matrix3d matrix = Matrix3d.Displacement(Point3d.Origin.GetVectorTo(new Point3d(obj.Size * 1.25, 0, 0)));
                dBText.Position = obj.Center.TransformBy(matrix);

                btr.AppendEntity(dBText);
                btr.AppendEntity(ellipse);
                trans.AddNewlyCreatedDBObject(dBText, true);
                trans.AddNewlyCreatedDBObject(ellipse, true);
                trans.Commit();
            }
        }
Пример #27
0
 public bool Checkout()
 {
     try
     {
         this._task.Status = States.GetTaskState(States.TaskState.REGISTERING);
         States.WriteLogger(this._task, States.LOGGER_STATES.REGISTERING, null, "", "");
         bool flag = true;
         while (flag)
         {
             flag = false;
             try
             {
                 this._srr = this._client.Get((this._task.SupremeRegion == TaskObject.SupremeRegionEnum.EU) ? "https://london.supremenewyork.com" : "https://register.supremenewyork.com").Text();
                 continue;
             }
             catch (WebException exception)
             {
                 if (!exception.Message.Contains("504") && !exception.Message.Contains("503"))
                 {
                     throw;
                 }
                 flag = true;
                 States.WriteLogger(this._task, States.LOGGER_STATES.CRASH_DETECTED, null, "", "1");
                 Thread.Sleep(0x3e8);
                 continue;
             }
         }
         if (this._srr.Contains("Registration has closed for this release"))
         {
             goto Label_1AC4;
         }
         this._currentDoc.LoadHtml(this._srr);
         string        str          = this._currentDoc.DocumentNode.Descendants("input").First <HtmlNode>(x => ((x.Attributes["name"] != null) && (x.Attributes["name"].Value == "authenticity_token"))).Attributes["value"].Value;
         string        str2         = this._currentDoc.DocumentNode.Descendants("meta").First <HtmlNode>(x => ((x.Attributes["name"] != null) && (x.Attributes["name"].Value == "csrf-token"))).Attributes["content"].Value;
         ProfileObject profile      = this._runner.Profile;
         object        solverLocker = Global.SolverLocker;
         lock (solverLocker)
         {
             Global.CAPTCHA_QUEUE.Add(this._task);
         }
         this._task.Status = States.GetTaskState(States.TaskState.WAITING_FOR_CATPCHA);
         States.WriteLogger(this._task, States.LOGGER_STATES.WAITING_FOR_CAPTCHA, null, "", "");
         this._task.Mre = new ManualResetEvent(false);
         CaptchaWaiter waiter = new CaptchaWaiter(this._task, new DateTime?(DateTime.Now), WebsitesInfo.SUPREME_CAPTCHA_KEY, "https://www.supremenewyork.com", "Supreme");
         waiter.Start();
         this._task.Mre.WaitOne();
         if (Global.CAPTCHA_QUEUE.Any <TaskObject>(x => x.Id == this._task.Id))
         {
             solverLocker = Global.SolverLocker;
             lock (solverLocker)
             {
                 Global.CAPTCHA_QUEUE.Remove(Global.CAPTCHA_QUEUE.First <TaskObject>(x => x.Id == this._task.Id));
                 this._task.ManualSolved = false;
             }
         }
         string str3     = "";
         string cCNumber = profile.CCNumber;
         while (cCNumber.Length > 4)
         {
             str3     = str3 + cCNumber.Substring(0, 4);
             cCNumber = cCNumber.Remove(0, 4);
             str3     = str3 + " ";
         }
         str3 = str3 + cCNumber;
         this._diData.Clear();
         this._diData.Add("utf8", "✓");
         this._diData.Add("authenticity_token", str);
         this._diData.Add("customer[name]", profile.FirstName + " " + profile.LastName);
         this._diData.Add("customer[email]", profile.Email);
         this._diData.Add("customer[tel]", profile.Phone);
         if (this._task.SupremeRegion == TaskObject.SupremeRegionEnum.USA)
         {
             this._diData.Add("customer[location_preference]", this._task.VariousStringData);
         }
         this._diData.Add("customer[street]", profile.Address1);
         this._diData.Add("customer[street_2]", profile.Address2);
         this._diData.Add("customer[zip]", profile.Zip);
         this._diData.Add("customer[city]", profile.City);
         if (this._task.SupremeRegion == TaskObject.SupremeRegionEnum.USA)
         {
             this._diData.Add("customer[state]", profile.StateId);
         }
         this._diData.Add("credit_card[cn]", str3);
         this._diData.Add("credit_card[month]", int.Parse(profile.ExpiryMonth).ToString());
         this._diData.Add("credit_card[year]", profile.ExpiryYear);
         this._diData.Add("credit_card[verification_value]", profile.Cvv);
         this._diData.Add("g-recaptcha-response", waiter.Token);
         if (this._runner.Profile.OnePerWebsite && Global.SUCCESS_PROFILES.Any <KeyValuePair <string, string> >(x => ((x.Key == this._task.CheckoutId) && (x.Value == this._runner.HomeUrl))))
         {
             this._task.Status = States.GetTaskState(States.TaskState.PROFILE_USED);
             States.WriteLogger(this._task, States.LOGGER_STATES.PROFILE_ALREADY_USED, null, "", "");
             return(false);
         }
         if (this._task.CheckoutDelay > 0)
         {
             Thread.Sleep(this._task.CheckoutDelay);
         }
         this._task.Status = States.GetTaskState(States.TaskState.SUBMITTING_REGISTRATION);
         States.WriteLogger(this._task, States.LOGGER_STATES.SUBMITTING_REGISTRATION, null, "", "");
         try
         {
             if ((this._runner._watch != null) && this._runner._watch.IsRunning)
             {
                 this._runner._watch.Stop();
             }
         }
         catch
         {
         }
         flag = true;
         while (flag)
         {
             flag = false;
             try
             {
                 this._client.Session.DefaultRequestHeaders.TryAddWithoutValidation("X-CSRF-Token", str2);
                 this._client.Session.DefaultRequestHeaders.Referrer = new Uri((this._task.SupremeRegion == TaskObject.SupremeRegionEnum.EU) ? "https://london.supremenewyork.com/signup/2" : "https://register.supremenewyork.com/signup/2");
                 this._client.Session.DefaultRequestHeaders.TryAddWithoutValidation("Origin", (this._task.SupremeRegion == TaskObject.SupremeRegionEnum.EU) ? "https://london.supremenewyork.com" : "https://register.supremenewyork.com");
                 this._srr = this._client.Post((this._task.SupremeRegion == TaskObject.SupremeRegionEnum.EU) ? "https://london.supremenewyork.com/customers" : "https://register.supremenewyork.com/customers", this._diData).Text();
                 continue;
             }
             catch (WebException exception2)
             {
                 if (!exception2.Message.Contains("504") && !exception2.Message.Contains("503"))
                 {
                     throw;
                 }
                 flag = true;
                 States.WriteLogger(this._task, States.LOGGER_STATES.CRASH_DETECTED, null, "", "1");
                 Thread.Sleep(0x3e8);
                 continue;
             }
         }
         if (this._srr.Contains("Registration has closed for this release"))
         {
             goto Label_1A92;
         }
         Global.Logger.Info("SupremeInstore: " + this._srr);
         this._dynObj = Newtonsoft.Json.JsonConvert.DeserializeObject(this._srr);
         string str5 = "";
         if (< > o__10.< > p__3 == null)
         {
             CSharpArgumentInfo[] argumentInfo = new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) };
             < > o__10.< > p__3 = CallSite <Func <CallSite, object, bool> > .Create(Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsTrue, typeof(SupremeInstore), argumentInfo));
         }
Пример #28
0
 public void AddExtra(CommentObject co, ProfileObject po)
 {
 }
Пример #29
0
 public Task <RequestResult <ProfileObject> > ChangeUserInfo(ProfileObject newUserInfo, string token, CancellationToken cts)
 {
     return(GetMockData <ProfileObject>(@"OrderKingCoreDemo.DAL.Resources.Mock.Hotel.Profile.json"));
 }