private void setDefaultValues(ref PersonalInfo personalinfo)
        {
            // Dash was used because space gets treated as
            // an empty field by the either the view or the controller
            // which messes up the details display

            if (personalinfo.Alias == null)
                personalinfo.Alias = "-";

            if (personalinfo.Street == null)
                personalinfo.Street = "-";

            if (personalinfo.Street2 == null)
                personalinfo.Street2 = "-";

            if (personalinfo.City == null)
                personalinfo.City = "-";

            // State is required when creating PersonalInfo

            if (personalinfo.Zip == null)
                personalinfo.Zip = "-";

            if (personalinfo.Phone == null)
                personalinfo.Phone = "-";

            if (personalinfo.UserId == null)
                personalinfo.UserId = -1;
        }
 public async Task<ActionResult> Index(PersonalInfoModel model)
 {
     int tempId = -1;
     var auth = new ApplicantAuth();
     var personalInfo = new PersonalInfo();
     
     if (ModelState.IsValid)
     {
         personalInfo.firstName = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(model.name_first.ToLower());
         personalInfo.middleName = model.name_middle == null ? model.name_middle : CultureInfo.CurrentCulture.TextInfo.ToTitleCase(model.name_middle);
         personalInfo.lastName = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(model.name_last.ToLower());
         personalInfo.alias = model.name_alt == null? model.name_alt : CultureInfo.CurrentCulture.TextInfo.ToTitleCase(model.name_alt.ToLower());
         personalInfo.street = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(model.street.ToLower());
         personalInfo.city = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(model.city.ToLower());
         personalInfo.state = model.state.ToUpper();
         personalInfo.email = model.email;
         personalInfo.zip = model.zip;
         personalInfo.Phone = model.phone_num;
         personalInfo.socialNum = model.ssn;
         personalInfo.applicantId = Convert.ToInt32(Session["ApplicantId"]);
         using (var client = new DataServiceClient())
         {
             client.Open();
             tempId = await client.updatePersonalInfoAsync(personalInfo);
             if (tempId > 0)
             {
                 if (((string)Session["Status"]).CompareTo("LoggedIn") != 0)
                 {
                     if (!await client.updateJobIdsAsync(tempId, (int[])this.Session["jobIds"]))
                     {
                         //error storing jobIds (when logged in this is stored after questionnair)    
                     }
                     else
                     {
                         this.Session["LocalJobs"] = "Done";
                     }
                 }
                 this.Session["ApplicantId"] = tempId;
                 this.Session["PersonalInfo"] = "Done";
                 auth.applicantId = tempId;
                 auth.password = model.password;
                 if (!await client.updatePasswordAsync(auth))
                 {
                     //error saving password 
                 }
                 Session["Status"] = "LoggedIn";
                 return RedirectToAction("Index", "Availability");
             }
             else
             {
                 //error occured, update failed
             }
             client.Close();
         }
     }
     return View(model);
 }
        // GET: /Application/
        public ActionResult Index(int jobId = 1)
        {
            var job = new Job()
            {
                JobId = jobId,
                Position = "Sales Associate",
                Description = "Customer Service, Stocking, Cashier",
                FullPartTime = "Part-time",
                SalaryRange = "$8.00 - $10.00 hourly",
                QuestionnaireId = 1,
                HoursId = 1
            };

            var applicant = new Applicant();
            var applicantQuestionAnswer = new ApplicantQuestionAnswer();
            var educations = new List<Education>();
            var jobHistories = new List<JobHistory>();
            var hour = new Hour();
            var references = new List<Reference>();
            var user = new User();
            var personalInfo = new PersonalInfo();

            var viewModel = new ApplicationViewModel()
            {
                Application = new Models.EntityModels.Application()
                {
                    DateCreated = DateTime.Now.Date,
                    JobId = jobId,
                },
                
                Job = job,
                Applicant = applicant,
                ApplicantQuestionAnswer = applicantQuestionAnswer,
                Education = educations,
                JobHistory = jobHistories,
                Hour = hour,
                Reference = references,
                User = user,
                PersonalInfo = personalInfo
            };

            return View(viewModel);
        }
Example #4
0
        /// <summary>
        /// General method to preprocess sets excluding invalid formes. (handled in a future method)
        /// </summary>
        /// <param name="set">Showdown set passed to the function</param>
        /// <param name="personal">Personal data for the desired form</param>
        public static void FixGender(this RegenTemplate set, PersonalInfo personal)
        {
            if (set.Species == (int)Species.Indeedee || set.Species == (int)Species.Meowstic)
            {
                set.Gender = set.FormIndex == 1 ? "F" : "M";
                return;
            }

            // Validate Gender
            if (personal.Genderless && set.Gender.Length == 0)
            {
                set.Gender = string.Empty;
            }
            else if (personal.OnlyFemale && set.Gender != "F")
            {
                set.Gender = "F";
            }
            else if (personal.OnlyMale && set.Gender != "M")
            {
                set.Gender = "M";
            }
        }
Example #5
0
        public IHttpActionResult PutPersonalInfo1(string id, PersonalInfo personalinfo)
        {
            try
            {
                personalinfo.Employee_id = DatabaseAction.GetEmployeeID(id);
                if (!ModelState.IsValid)
                {
                    return(BadRequest(ModelState));
                }


                db.Entry(personalinfo).State = EntityState.Modified;

                db.SaveChanges();
                return(Ok("Personalinfo Details Updated Successfully"));
            }
            catch (Exception ex)
            {
                LogFile.WriteLog(ex);
                return(BadRequest());
            }
        }
Example #6
0
        public string About()
        {
            ViewBag.Message = "Your application description page.";

            using (ResumeCreatorEntities context = new ResumeCreatorEntities())
            {
                PersonalInfo p = new PersonalInfo()
                {
                    first_name = "Ibad",
                    last_name  = "Ullah",
                    city       = "Peshawar",
                    state      = "KPK",
                    zip_code   = "25000",
                    address    = "Gulabahar # 3,Rasheed Town",
                    email      = "*****@*****.**",
                    phone      = "03143005033"
                };
                context.PersonalInfoes.Add(p);
                context.SaveChanges();
                return(p.id + " ");
            }
        }
Example #7
0
 public override void Markslots()
 {
     IV3          = new bool[SpecForm.Length];
     RandomGender = new bool[SpecForm.Length];
     Gender       = new byte[SpecForm.Length];
     for (int i = 0; i < SpecForm.Length; i++)
     {
         if (SpecForm[i] == 0)
         {
             continue;
         }
         PersonalInfo info        = PersonalTable.USUM.getFormeEntry(SpecForm[i] & 0x7FF, SpecForm[i] >> 11);
         byte         genderratio = (byte)info.Gender;
         IV3[i]          = info.EggGroups[0] == 0xF && !Pokemon.BabyMons.Contains(SpecForm[i] & 0x7FF);
         Gender[i]       = FuncUtil.getGenderRatio(genderratio);
         RandomGender[i] = FuncUtil.IsRandomGender(genderratio);
     }
     if (UB)
     {
         IV3[0] = true;     // For UB Template
     }
 }
        //Employee PersonalInfo
        public async Task AddEmployeePersonalInfo(PersonalInfo user)
        {
            using (var sqlConnection = new SqlConnection(connectionString))
            {
                await sqlConnection.OpenAsync();

                var dynamicParameters = new DynamicParameters();
                dynamicParameters.Add("@StatementType", "Insert");
                dynamicParameters.Add("@EmployeeId", user.EmployeeId);
                dynamicParameters.Add("@BLOBData", user.mobile);
                dynamicParameters.Add("@EmployeeId", user.otherEmail);
                dynamicParameters.Add("@BLOBData", user.dob);
                dynamicParameters.Add("@EmployeeId", user.maritalStatus);
                dynamicParameters.Add("@BLOBData", user.address);
                dynamicParameters.Add("@EmployeeId", user.tags);

                await sqlConnection.ExecuteAsync(
                    "spSelectInsertUpdateDeleteEmpPersonalInfo",
                    dynamicParameters,
                    commandType : CommandType.StoredProcedure);
            }
        }
Example #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        x.Id = 1;
        d.Id = 1;

        x = Q.Patients.Where(z => z.Id == x.Id).SingleOrDefault();
        p = Q.PersonalInfos.Where(w => w.Id == x.PersonalInfoId).SingleOrDefault();

        d = Q.Doctors.Where(z => z.Id == d.Id).SingleOrDefault();
        PersonalInfo p1 = Q.PersonalInfos.Where(w => w.Id == d.PersonalInfoId).SingleOrDefault();

        if (!IsPostBack)
        {
            Label3.Text           = x.Id.ToString();
            Label3.ForeColor      = System.Drawing.Color.Red;
            Label3.Font.Underline = true;


            Label15.Text           = d.Id.ToString();
            Label15.ForeColor      = System.Drawing.Color.Red;
            Label15.Font.Underline = true;


            Label5.Text      = p.FirstName;
            Label5.ForeColor = System.Drawing.Color.Red;


            Label6.Text      = p.LastName;
            Label6.ForeColor = System.Drawing.Color.Red;


            Label8.Text      = p1.FirstName;
            Label8.ForeColor = System.Drawing.Color.Red;


            Label9.Text      = p1.LastName;
            Label9.ForeColor = System.Drawing.Color.Red;
        }
    }
Example #10
0
        private void RandomizeTMHM(PersonalInfo z)
        {
            var tms = z.TMHM;

            if (Settings.ModifyLearnsetTM)
            {
                for (int j = 0; j < tmcount; j++)
                {
                    tms[j] = Rand.Next(100) < Settings.LearnTMPercent;
                }
            }

            if (Settings.ModifyLearnsetHM)
            {
                for (int j = tmcount; j < tms.Length; j++)
                {
                    tms[j] = Rand.Next(100) < Settings.LearnTMPercent;
                }
            }

            z.TMHM = tms;
        }
Example #11
0
    void Test()
    {
        Stack tempRankList = new Stack();

        tempRankList.Push(1);
        tempRankList.Push(2);
        RoomInfo roomInfo = new RoomInfo();

        roomInfo.roomID = 1545435.ToString();
        roomInfo.member = new List <PersonalInfo>();
        PersonalInfo personalInfo = new PersonalInfo();

        personalInfo.id = 1;
        roomInfo.member.Add(personalInfo);
        PersonalInfo personalInfo1 = new PersonalInfo();

        personalInfo.id = 2;

        roomInfo.member.Add(personalInfo1);

        int id;

        for (int i = 0; i < 2; i++)//tempRankList.Count
        {
            id = (int)tempRankList.Pop();
            Debug.Log("-------id:" + id);
            PersonalInfo personal = roomInfo.member.Find(it =>
            {
                if (it.id == id)//tempRankList空的
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            });
        }
    }
        private void RandomizeTMHMSimple(PersonalInfo z)
        {
            var tms = z.TMHM;

            if (ModifyLearnsetTM)
            {
                for (int j = 0; j < tmcount; j++)
                {
                    tms[j] = rnd.Next(0, 100) < LearnTMPercent;
                }
            }

            if (ModifyLearnsetHM)
            {
                for (int j = tmcount; j < tms.Length; j++)
                {
                    tms[j] = rnd.Next(0, 100) < LearnTMPercent;
                }
            }

            z.TMHM = tms;
        }
Example #13
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            personalInfo = await api.LoadMe();

            if (personalInfo != null)
            {
                WelcomeBlock.Text           = string.Format("Welcome back, {0}!", personalInfo.firstName);
                UsernameBox.Text            = personalInfo.email;
                CreateAccountButton.Content = "Login using Windows Hello";
            }
            else
            {
                return;
            }

            var loginCredential = GetCredentialFromLocker();

            if (loginCredential == null)
            {
                return;
            }


            UserConsentVerificationResult consentResult = await UserConsentVerifier.RequestVerificationAsync(string.Format("Welcome back, {0}!", personalInfo.firstName));

            if (consentResult.Equals(UserConsentVerificationResult.Verified))
            {
                ProgressWorking.Visibility = Visibility.Visible;
                if (await api.RenewToken())
                {
                    LoadData();
                }
                else
                {
                    await new MessageDialog("We've lost authentication. Please log in again!").ShowAsync();
                }
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            bool result = isTrue(context);

            if (result)
            {
                context.Response.ContentType = "text/html";
                PersonalInfo info = getData(context);

                PersonalService     service     = new PersonalService();
                List <PersonalInfo> resultCount = service.SelectWithParameter(info);

                if (resultCount.ToArray().Length > 0)
                {
                    for (int i = 0; i < resultCount.ToArray().Length; i++)
                    {
                        if (resultCount[i].PId.Equals(info.PId) && resultCount[i].Pwd.Equals(info.Pwd))
                        {
                            Alert.AlertMessage("登录成功");
                            context.Session.Add("personalID", resultCount[i].Id);
                            context.Response.Redirect("../asp/Backstage/EmployeePersonalCenter.aspx");
                        }
                        else
                        {
                            Alert.AlertFailed("登录失败,用户名或密码错误");
                        }
                    }
                }
                else
                {
                    Alert.AlertFailed("登录失败,请确定是否有此用户");
                }
            }
            else
            {
                Alert.AlertFailed("登录失败,用户名或密码错误");
            }
        }
Example #15
0
        public void ProcessRequest(HttpContext context)
        {
            bool result = isTrue(context);

            if (result)
            {
                context.Response.ContentType = "text/html";
                PersonalInfo info = getData(context);
                if (new PersonalService().Update(info))
                {
                    Alert.AlertMessage("修改成功");
                    context.Response.Redirect("../asp/Backstage/EmployeeInformation.aspx?personalID=" + info.Id);
                }
                else
                {
                    Alert.AlertFailed("修改失败");
                }
            }
            else
            {
                Alert.AlertFailed("修改失败,请检查填写数据是否为空");
            }
        }
Example #16
0
        public int GetRandomSpecies(int oldSpecies)
        {
            // Get a new random species
            PersonalInfo oldpkm = SpeciesStat[oldSpecies];

            loopctr = 0; // altering calculations to prevent infinite loops
            int newSpecies;

            while (!GetNewSpecies(oldSpecies, oldpkm, out newSpecies))
            {
                if (loopctr > 0x0001_0000)
                {
                    PersonalInfo pkm = SpeciesStat[newSpecies];
                    if (IsSpeciesBSTBad(oldpkm, pkm) && loopctr > 0x0001_1000) // keep trying for at minimum BST
                    {
                        continue;
                    }
                    return(newSpecies); // failed to find any match based on criteria, return random species that may or may not match criteria
                }
                loopctr++;
            }
            return(newSpecies);
        }
Example #17
0
        /// <summary>
        /// General method to preprocess sets excluding invalid formes. (handled in a future method)
        /// </summary>
        /// <param name="set">Showdown set passed to the function</param>
        /// <param name="personal">Personal data for the desired form</param>
        private static ShowdownSet PreProcessShowdownSet(this ShowdownSet set, PersonalInfo personal)
        {
            if ((set.Species == (int)Species.Indeedee || set.Species == (int)Species.Meowstic) && set.Form == "F")
            {
                set = new ShowdownSet(set.Text.Replace("(M)", "(F)"));
            }

            // Validate Gender
            if (personal.Genderless && set.Gender.Length == 0)
            {
                return(new ShowdownSet(set.Text.Replace("(M)", "").Replace("(F)", "")));
            }
            if (personal.OnlyFemale && set.Gender != "F")
            {
                return(new ShowdownSet(set.Text.Replace("(M)", "(F)")));
            }
            if (personal.OnlyMale && set.Gender != "M")
            {
                return(new ShowdownSet(set.Text.Replace("(F)", "(M)")));
            }

            return(set);
        }
Example #18
0
        public PersonalInfo GetPersonalInfo()
        {
            var personalInfo = new PersonalInfo();

            using (var sqlite_conn = CreateConnection())
            {
                var sqlite_cmd = sqlite_conn.CreateCommand();
                sqlite_cmd.CommandText =
                    "SELECT Id, Name, SureName, Email, Phone FROM PersonalInfo";

                var sqlite_datareader = sqlite_cmd.ExecuteReader();
                while (sqlite_datareader.Read())
                {
                    personalInfo.Id      = sqlite_datareader.GetString(0);
                    personalInfo.Name    = sqlite_datareader.GetString(1);
                    personalInfo.Surname = sqlite_datareader.GetString(2);
                    personalInfo.Email   = sqlite_datareader.GetString(3);
                    personalInfo.Phone   = sqlite_datareader.GetString(4);
                }
            }

            return(personalInfo);
        }
Example #19
0
        private void RandomizeStats(PersonalInfo z)
        {
            // Fiddle with Base Stats, don't muck with Shedinja.
            var stats = z.Stats;

            if (stats[0] == 1)
            {
                return;
            }
            int RandDeviation() => Rand.Next(Settings.StatDeviationMin, Settings.StatDeviationMax);

            for (int i = 0; i < stats.Length; i++)
            {
                if (!Settings.StatsToRandomize[i])
                {
                    continue;
                }

                var val  = stats[i] * RandDeviation() / 100;
                var stat = Math.Max(1, Math.Min(255, val));
            }
            z.Stats = stats;
        }
Example #20
0
        public async Task <Result> ChangePersInfo(PersonalInfo info)
        {
            var user = await _userManager.FindByEmailAsync(User.Identity.Name);

            var isValid = await _userManager.CheckPasswordAsync(user, info.OldPassword);

            if (isValid)
            {
                await _userManager.ChangePasswordAsync(user, info.OldPassword, info.NewPassword);

                return(new Result()
                {
                    Successful = true, Error = "Password was changed successfully"
                });
            }
            else
            {
                return(new Result()
                {
                    Successful = false, Error = "You entered wrong password"
                });
            }
        }
Example #21
0
        // GET: PersonalInfoes/Delete/5
        public ActionResult Delete(int?id)
        {
            if (Session["isAdmin"] == null)
            {
                return(RedirectToAction("Login", "Home"));
            }
            else if (Session["isAdmin"].ToString() != "True")
            {
                return(RedirectToAction("Login", "Home"));
            }

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PersonalInfo personalInfo = db.PersonalInfoes.Find(id);

            if (personalInfo == null)
            {
                return(HttpNotFound());
            }
            return(View(personalInfo));
        }
        public async Task <ActionResult> Register(string login, string password, string fio, string city, string phone, int id_faculty, int id_department, int id_group)
        {
            if (await db.Users.FirstOrDefaultAsync(x => x.Login == login) == null)
            {
                var newUser = new User
                {
                    Login    = login,
                    Password = PasswordHash.GetPasswordHash(password),
                    IdGroup  = id_group,
                    IdRole   = 2
                };
                db.Users.Add(newUser);
                await db.SaveChangesAsync();

                var user = (await(from users in db.Users
                                  where users.Login == login
                                  select users).FirstOrDefaultAsync());
                var newPersonalInfo = new PersonalInfo
                {
                    Name         = fio,
                    IdFaculty    = id_faculty,
                    IdDepartment = id_department,
                    IdRole       = 2,
                    IdGroup      = id_group,
                    IdUser       = user.Id,
                    Phone        = phone,
                    City         = city,
                    AboutInfo    = "О себе",
                    Photo        = "/Content/defaultphoto.jpg"
                };
                db.PersonalInfoes.Add(newPersonalInfo);
                await db.SaveChangesAsync();

                return(Json(new { Success = true }));
            }
            return(Json(new { Success = false, Error = "This user already exists!" }));
        }
Example #23
0
        public void ProcessRequest(HttpContext context)
        {
            bool result = isTrue(context);

            if (result)
            {
                HttpRequest request = context.Request;
                context.Response.ContentType = "text/html";
                PersonalInfo info = new PersonalInfo();
                info.Id  = context.Session["personalID"].ToString();
                info.Pwd = request["Pwd"];

                PersonalService service = new PersonalService();
                if (service.SelectWithParameter(info).ToArray().Length > 0)
                {
                    info.Pwd = request["NewPwd"];
                    if (service.Update(info))
                    {
                        Alert.AlertMessage("修改成功");
                        context.Session.Add("personalID", info.Id);
                        context.Response.Redirect("../asp/Backstage/EmployeePwd.aspx");
                    }
                    else
                    {
                        Alert.AlertFailed("修改失败,请重试");
                    }
                }
                else
                {
                    Alert.AlertFailed("修改失败,原密码错误");
                }
            }
            else
            {
                Alert.AlertFailed("修改失败,请检查填写内容是否正确");
            }
        }
Example #24
0
        public override void Markslots()
        {
            IV3          = new bool[SpecForm.Length];
            RandomGender = new bool[SpecForm.Length];
            Gender       = new byte[SpecForm.Length];
            var smslot = new int[0].ToList();

            for (int i = 0; i < SpecForm.Length; i++)
            {
                if (SpecForm[i] == 0)
                {
                    continue;
                }
                PersonalInfo info        = PersonalTable.USUM.getFormeEntry(SpecForm[i] & 0x7FF, SpecForm[i] >> 11);
                byte         genderratio = (byte)info.Gender;
                IV3[i]          = info.EggGroups[0] == 0xF && !Pokemon.BabyMons.Contains(SpecForm[i] & 0x7FF);
                Gender[i]       = FuncUtil.getGenderRatio(genderratio);
                RandomGender[i] = FuncUtil.IsRandomGender(genderratio);
                if (Static && info.Types.Contains(Pokemon.electric) || Magnet && info.Types.Contains(Pokemon.steel)) // Collect slots
                {
                    smslot.Add(i);
                }
            }
            StaticMagnetSlot = smslot.Select(s => (byte)s).ToArray();
            if (0 == (NStaticMagnetSlot = (ulong)smslot.Count))
            {
                Static = Magnet = false;
            }
            if (ModifiedLevel == 101)
            {
                ModifiedLevel = Levelmax;
            }
            if (UB)
            {
                IV3[0] = true;     // For UB Template
            }
        }
Example #25
0
 /// <summary>
 /// PageLoad event handler.
 /// </summary>
 /// <param name="sender">Object sender.</param>
 /// <param name="e">EventArgs e.</param>
 protected void Page_Load(Object sender, EventArgs e)
 {
     Guid.TryParse("e80cd2ac-8517-4e95-8321-3f4593d2106a", out this._userID);
     if (!Page.IsPostBack)
     {
         PersonalInfo personalInfo = PersonalInfoRepository.GetUserInfo(this._userID);
         fvMain.DataSource = new List <PersonalInfo> {
             personalInfo
         };
         fvAddress.DataSource = new List <Address> {
             AddressRepository.GetUserAddress(this._userID)
         };
         imgAvatar.ImageUrl = personalInfo.ImagePath;
         if (this.imgAvatar.ImageUrl == Constants._defaultAvatarImage)
         {
             imgAvatar.ImageUrl = String.Concat(Constants._defaultPhotoPath, Constants._defaultAvatarImage);
         }
         else
         {
             this.imgAvatar.ImageUrl = String.Concat(Constants._defaultPhotoPath, imgAvatar.ImageUrl);
         }
         Page.DataBind();
     }
 }
Example #26
0
        public void testFill()
        {
            PersonalInfo test = new PersonalInfo();

            test.PhoneNumber      = "535501994";
            test.FirstName        = "Dawid";
            test.LastName         = "Stachowiak";
            test.DateOfBirth      = Convert.ToDateTime("28-07-1994");
            test.PropertyChanged += (s, e) => {
                //testCommand();
            };
            PersonalInfo test2 = new PersonalInfo();

            test2.PhoneNumber      = "5355019945123";
            test2.FirstName        = "Daw123id";
            test2.LastName         = "Stacho123wiak";
            test2.DateOfBirth      = Convert.ToDateTime("28-05-1994");
            test2.PropertyChanged += (s, e) => {
                //testCommand();
            };

            personalInfoCollection.Add(test);
            personalInfoCollection.Add(test2);
        }
Example #27
0
        private bool GetNewSpecies(int currentSpecies, PersonalInfo oldpkm, out int newSpecies)
        {
            newSpecies = RandSpec.Next();
            PersonalInfo pkm = SpeciesStat[newSpecies];

            // Verify it meets specifications
            if (IsSpeciesReplacementBad(newSpecies, currentSpecies)) // no A->A randomization
            {
                return(false);
            }
            if (IsSpeciesEXPRateBad(oldpkm, pkm))
            {
                return(false);
            }
            if (IsSpeciesTypeBad(oldpkm, pkm))
            {
                return(false);
            }
            if (IsSpeciesBSTBad(oldpkm, pkm))
            {
                return(false);
            }
            return(true);
        }
Example #28
0
    protected void Page_Load(object sender, EventArgs e)
    {
        np.Id        = 5;
        np           = Q.NursePreviews.Where(z => z.Id == np.Id).SingleOrDefault();
        Label12.Text = np.Id.ToString();
        if (np.TypeOfOperation == 1)
        {
            Label2.Text = "Test";
        }
        else
        {
            Label2.Text = "Xray";
        }

        Label4.Text     = np.DateOfOperation.ToString().Substring(0, 10);
        Label7.Text     = np.Description;
        Label8.Text     = np.Note;
        Image1.ImageUrl = np.XRayPhotoPath;

        n = Q.Nurses.Where(z => z.Id == np.NurseId).SingleOrDefault();
        p = Q.PersonalInfos.Where(d => d.Id == n.PersonalInfoId).SingleOrDefault();

        Label10.Text = p.FirstName + " " + p.LastName;
    }
Example #29
0
 /// <summary>
 /// 跳转到选中好友的聊天面板
 /// </summary>
 void OnToggleClick(PersonalInfo personalInfo, Toggle select_tog, bool isOn, Color color, Image msgCount_T)
 {
     if (selectedID == personalInfo.id)
     {
         return;
     }
     if (isOn)
     {
         selectedID = personalInfo.id;
         if (MessageInfo.unReadMsg.ContainsKey(selectedID))
         {
             MessageInfo.unReadMsg.Remove(selectedID);
         }
         GameAudio.instance.PlayAudioSourceUI("select");
         Debug.Log("跳转到选中好友的聊天面板");
         DealWithDeafuatMan(personalInfo, select_tog, color, msgCount_T);
         DisplayMassage(true);
     }
     else
     {
         select_tog.GetComponent <Image>().color = color;
         //Debug.Log("加载不到……");
     }
 }//跳转到选中好友的聊天面板
Example #30
0
        private void gridView1_CellValueChanged(object sender, CellValueChangedEventArgs e)
        {
            PersonPayRateInput row = gridView1.GetRow(e.RowHandle) as PersonPayRateInput;

            if (row != null)
            {
                if (e.Column.FieldName == "员工编号")
                {
                    PersonalInfo pInfo = PersonalInfo.Get(row.员工编号);
                    if (pInfo == null)
                    {
                        MessageBox.Show("找不到指定编号的员工");
                    }
                    else
                    {
                        row.姓名 = pInfo.姓名;
                        row.职务 = pInfo.职务;
                        gridControl1.RefreshDataSource();
                    }
                }

                row.GetModifiyFields();
            }
        }
        /// <summary>
        /// Update a pserson
        /// </summary>
        /// <param name="personalInfo"></param>
        public void UpdatePersonalInfo(PersonalInfo personalInfo)
        {
            string queryString = "UpdatePersonalInfo";

            // Check connection and input
            if (_connection == null || personalInfo == null)
            {
                return;
            }

            OpenConnection();

            SqlCommand command = new SqlCommand(queryString, _connection);

            command.CommandType = CommandType.StoredProcedure;

            command.Parameters.AddWithValue("@Id", personalInfo.Id);
            command.Parameters.AddWithValue("@FirstName", personalInfo.Name.FirstName);
            command.Parameters.AddWithValue("@MiddleName", personalInfo.Name.MiddleName);
            command.Parameters.AddWithValue("@LastName", personalInfo.Name.LastName);
            command.Parameters.AddWithValue("@Address1", personalInfo.Address.Address1);
            command.Parameters.AddWithValue("@Address2", personalInfo.Address.Address2);
            command.Parameters.AddWithValue("@City", personalInfo.Address.City);
            command.Parameters.AddWithValue("@State", personalInfo.Address.State);
            command.Parameters.AddWithValue("@ZipCode", personalInfo.Address.ZipCode);
            command.Parameters.AddWithValue("@AreaCode", personalInfo.PhoneNumber.AreaCode);
            command.Parameters.AddWithValue("@PhoneNumber", personalInfo.PhoneNumber.PhoneNumber);
            command.Parameters.AddWithValue("@SSN", personalInfo.SSN.SSNNumber);
            command.Parameters.AddWithValue("@Gender", personalInfo.Gender);
            command.Parameters.AddWithValue("@DateOfBirth", personalInfo.DateOfBirth);
            command.Parameters.AddWithValue("@DateModified", DateTime.Now);

            command.ExecuteNonQuery();

            CloseConnection();
        }
Example #32
0
        // GET: PersonalInfoes/Edit/5
        public ActionResult Edit(int?id)
        {
            if (Session["isAdmin"] == null)
            {
                return(RedirectToAction("Login", "Home"));
            }
            else if (Session["isAdmin"].ToString() != "True")
            {
                return(RedirectToAction("Login", "Home"));
            }

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PersonalInfo personalInfo = db.PersonalInfoes.Find(id);

            if (personalInfo == null)
            {
                return(HttpNotFound());
            }
            ViewBag.UserID = new SelectList(db.Users, "UserID", "FirstName", personalInfo.UserID);
            return(View(personalInfo));
        }
        public void ProcessRegistration(PersonalInfo personalInfo,
            int eventID, FormData.XAuthType xAuthType, SelectRegTypeFunc regTypeFunc = null)
        {
            OpenRegisterPage(eventID);
            CheckinWithEmail(personalInfo.Email);

            if (regTypeFunc != null)
            {
                regTypeFunc(xAuthType);
            }

            Continue();

            if (OnLoginPage())
            {
                switch (xAuthType)
                {
                    case FormData.XAuthType.ByEmail:
                        break;
                    case FormData.XAuthType.ByEmailPassword:
                        TypeLoginPagePassword(((XAuthPersonalInfo)personalInfo).XAuthPassword);
                        break;
                    case FormData.XAuthType.ByUserName:
                        XAuth_TypeUserId(((XAuthPersonalInfo)personalInfo).UserName);
                        break;
                    case FormData.XAuthType.ByUserNamePassword:
                        XAuth_TypeUserId(((XAuthPersonalInfo)personalInfo).UserName);
                        TypeLoginPagePassword(((XAuthPersonalInfo)personalInfo).XAuthPassword);
                        break;
                    case FormData.XAuthType.NotUse:
                        TypeLoginPagePassword(personalInfo.Password);
                        break;
                    default: break;
                }
                Continue();
            }
            //PI
            if (xAuthType != FormData.XAuthType.NotUse)
            {
                XAuth_SetDefaultStandardPersonalInfoFields((XAuthPersonalInfo)personalInfo, false);
            }
            else
            {
                SetDefaultStandardPersonalInfoFields(personalInfo, false);
            }
            switch (xAuthType)
            {
                case FormData.XAuthType.ByEmail:
                case FormData.XAuthType.ByUserName:
                    TypePersonalInfoPassword(((XAuthPersonalInfo)personalInfo).XAuthPassword);
                    TypePersonalInfoVerifyPassword(((XAuthPersonalInfo)personalInfo).XAuthPassword);
                    break;
                case FormData.XAuthType.NotUse:
                    TypePersonalInfoPassword(personalInfo.Password);
                    TypePersonalInfoVerifyPassword(personalInfo.Password);
                    break;
                case FormData.XAuthType.ByEmailPassword:
                case FormData.XAuthType.ByUserNamePassword:
                    break;
                default: break;
            }
            Continue();

            //Checkout
            //SelectPaymentMethod(Managers.ManagerBase.PaymentMethod.Check);
            FinishRegistration();
            //ConfirmRegistration();
        }
 public void SetDefaultStandardPersonalInfoFields(PersonalInfo personalInfo, bool isAttendeeExisted)
 {
     if (!isAttendeeExisted)
     {
         if (IsEmailFieldPresent())
         {
             this.TypePersonalInfoEmail(personalInfo.Email);
         }
         if (IsFirstNameFieldPresent())
         {
             this.TypePersonalInfoFirstName(personalInfo.FirstName);
         }
         if (IsMiddleNameFieldPresent())
         {
             this.TypePersonalInfoMiddleName(personalInfo.MiddleName);
         }
         if (IsLastNameFieldPresent())
         {
             this.TypePersonalInfoLastName(personalInfo.LastName);
         }
     }
     this.TypePersonalInfoJobTitle(personalInfo.JobTitle);
     this.TypePersonalInfoCompany(personalInfo.Company);
     this.TypePersonalInfoAddressLineOne(personalInfo.Address1);
     this.TypePersonalInfoAddressLineTwo(personalInfo.Address2);
     this.TypePersonalInfoCity(personalInfo.City);
     this.SelectPersonalInfoState(personalInfo.State);
     this.TypePersonalInfoZipCode(personalInfo.Zip);
     this.TypePersonalInfoWorkPhone(personalInfo.Phone);
     this.TypePersonalInfoExtension(personalInfo.Extension);
     this.TypePersonalInfoFax(personalInfo.Fax);
 }
Example #35
0
File: PK1.cs Project: kwsch/PKHeX
        public override ushort[] getStats(PersonalInfo p)
        {
            ushort[] Stats = new ushort[6];
            for (int i = 0; i < Stats.Length; i++)
            {
                ushort L = (ushort)Stat_Level;
                ushort B = (ushort)p.Stats[i];
                ushort I = (ushort)IVs[i];
                ushort E = // Fixed formula via http://www.smogon.com/ingame/guides/rby_gsc_stats
                    (ushort)Math.Floor(Math.Min(255, Math.Floor(Math.Sqrt(Math.Max(0, EVs[i] - 1)) + 1)) / 4.0);
                Stats[i] = (ushort)Math.Floor((2 * (B + I) + E) * L / 100.0 + 5);
            }
            Stats[0] += (ushort)(5 + Stat_Level); // HP

            return Stats;
        }
        /// <summary>
        /// Create user access
        /// </summary>
        /// <returns>access id</returns>
        public string CreateUserAccess(string userTitle, string userName, string userFirstname, string userPhoneNumber, string backUrl, bool isMainContractor, string termAndConditionsUrl, bool isCustomer)
        {
            try
            {
                //#3- Ouverture d'un acces pour utilisateur
                //TODO : Data from certificate
                UserDN userDN = new UserDN()
                {
                    countryName = "FR",
                    organizationName = "Dictao Trust Services Application CA",
                    organizationalUnitName = "AnySign",
                    //emailAddress = "TODO",
                    commonName = "SAAS QA DTP UPSIDEO Client",
                };

                string user = (isCustomer) ? "USER-CUSTOMER" : "USER-ADVISER";
                PersonalInfo personalInfo = new PersonalInfo()
                {
                    user = user,
                    mainContractor = isMainContractor,
                    title = userTitle,
                    firstName = userFirstname,
                    lastName = userName,
                    userDN = userDN
                };


                string consent = "J'ai bien lu les documents ci-contre que j'accepte de signer selon les termes des conditions générales et de la convention de preuve. J'ai connaissance du fait que la signature des documents au moyen d'une signature électronique manifeste mon consentement aux droits et obligations qui en découlent, au même titre qu'une signature manuscrite. J'accepte la ${TermAndConditionsUrl}."; // et la convention de preuve
                UIInfo uiInfo = new UIInfo()
                {
                    ui = "standard",
                    backUrl = backUrl,
                    consent = consent,
                    termAndConditionsUrl = termAndConditionsUrl
                };

                // Check phone number
                // After DICTAO update, this checking is outdated
                /*Match match = Regex.Match(userPhoneNumber, @"[0-9]{10}", RegexOptions.IgnoreCase);

                if (!match.Success)
                {
                    throw new Exception(string.Format(@"La signature électronique requiert un numéro de téléphone valide composé exactement de 10 chiffres. <br />
                                        Le numéro &laquo;{0}&raquo; est incorrect.", userPhoneNumber));
                }*/

                //Phone number should be composed only with [0-9]+
                userPhoneNumber = this.GetCorrectDictaoMobile(userPhoneNumber);

                AuthenticationInfo authentificationInfo = new AuthenticationInfo()
                {
                    //phoneNumber = (!string.IsNullOrEmpty(userPhoneNumber)) ? userPhoneNumber : "0000000000",
                    phoneNumber = userPhoneNumber,
                    userId = System.Guid.NewGuid().ToString()
                };

                addUserAccess addUserAccess = new addUserAccess()
                {
                    transactionId = TransactionId,
                    userInfo = personalInfo,
                    uiInfo = uiInfo,
                    authenticationInfo = authentificationInfo,
                    externalAccessId = null,
                    singleUsage = true,
                    timeout = (long)3600000, //ms
                    metadata = null
                };

                addUserAccessResponse addUserAccessResponse = _TransactionPortCli.addUserAccess(addUserAccess);
                string accessId = addUserAccessResponse.accessId;

                return accessId;
            }
            catch (Exception ex)
            {
                //this.CancelTransaction();
                string errorMessage = "Il est impossible de signer électroniquement votre document car le numéro de mobile indiqué n'est pas valide.";

                string showError = Convert.ToString(System.Configuration.ConfigurationManager.AppSettings["ShowErrors"]);
                if (!string.IsNullOrEmpty(showError) && showError == "1")
                {
                    errorMessage = string.Format("{0} : {1}", ex.Message, ex.StackTrace);
                }
                throw new Exception(errorMessage);
            }
        }
Example #37
0
        public static async Task KnowYourCustomerAsync()
        {
            // A workaround to support version 1.0. Can be removed once v1.0 becomes obsolete.
            KycRequest.KycVersion = "1.0";

            #region Device Level

            // Generate OTP
            await Otp.GenerateOtpAsync("999999990019");

            // Set Personal Info
            Console.Write("Enter OTP sent to mobile: ");
            var personalInfo = new PersonalInfo
            {
                AadhaarNumber = "999999990019",
                PinValue      = new PinValue {
                    Otp = Console.ReadLine()
                }
            };

            // Set Device Info
            var kycContext = new KycContext
            {
                DeviceInfo = Configuration.DeviceInfo.Create()
            };

            // Ask for Resident Consent
            Console.Write("Access personal information? (y/n)\t\t");
            kycContext.HasResidentConsent = Console.ReadLine() == "y";

            Console.Write("Access information in Indian language? (y/n)\t");
            kycContext.AccessILInfo = Console.ReadLine() == "y";

            Console.Write("Access mobile and email information? (y/n)\t");
            kycContext.AccessMobileAndEmail = Console.ReadLine() == "y";

            // Encrypt Data
            using (var sessionKey = new SessionKey(Configuration.UidaiEncryptionKeyPath, true))
                await kycContext.EncryptAsync(personalInfo, sessionKey);

            #endregion

            #region Device To Agency
            // TODO: Wrap DeviceContext{T} into AUA specific protocol and send it to AUA.
            // On Device Side:
            // var deviceXml = deviceContext.ToXml();
            // var wrapped = WrapIntoAuaProtocol(deviceXml);

            // On Agency Side:
            // var auaXml = UnwrapFromAuaProtocol(wrapped);
            // var auaContext = new KycContext();
            // auaContext.FromXml(auaXml);
            #endregion

            #region Agency Level

            // Perform e-Know Your Customer
            var apiClient = new KycClient
            {
                AgencyInfo = Configuration.AgencyInfo,
                Request    = new KycRequest(kycContext)
                {
                    Signer = Signer
                },
                Response = new KycResponse {
                    Decryptor = Decryptor, Verifier = Verifier
                }
            };
            await apiClient.GetResponseAsync();

            Console.WriteLine(string.IsNullOrEmpty(apiClient.Response.ErrorCode)
                ? $"Customer Name: {apiClient.Response.Resident.Demographic.Identity.Name}"
                : $"Error Code: {apiClient.Response.ErrorCode}");

            #endregion

            #region Agency To Device
            // TODO: Wrap KycResponse into AUA specific protocol and send it to device.
            #endregion
        }
Example #38
0
File: PKM.cs Project: kwsch/PKHeX
        public virtual ushort[] getStats(PersonalInfo p)
        {
            int level = CurrentLevel;
            ushort[] Stats = new ushort[6];
            Stats[0] = (ushort)(p.HP == 1 ? 1 : ((HT_HP ? 31 : IV_HP) + 2 * p.HP + EV_HP / 4 + 100) * level / 100 + 10);
            Stats[1] = (ushort)(((HT_ATK ? 31 : IV_ATK) + 2 * p.ATK + EV_ATK / 4) * level / 100 + 5);
            Stats[2] = (ushort)(((HT_DEF ? 31 : IV_DEF) + 2 * p.DEF + EV_DEF / 4) * level / 100 + 5);
            Stats[4] = (ushort)(((HT_SPA ? 31 : IV_SPA) + 2 * p.SPA + EV_SPA / 4) * level / 100 + 5);
            Stats[5] = (ushort)(((HT_SPD ? 31 : IV_SPD) + 2 * p.SPD + EV_SPD / 4) * level / 100 + 5);
            Stats[3] = (ushort)(((HT_SPE ? 31 : IV_SPE) + 2 * p.SPE + EV_SPE / 4) * level / 100 + 5);

            // Account for nature
            int incr = Nature / 5 + 1;
            int decr = Nature % 5 + 1;
            if (incr == decr) return Stats;
            Stats[incr] *= 11; Stats[incr] /= 10;
            Stats[decr] *= 9; Stats[decr] /= 10;
            return Stats;
        }
Example #39
0
    public PersonalInfo GetNewEmail(string NAME_ENG, string SURNAME_ENG)
    {
        PersonalInfo Result = new PersonalInfo();

        string SQL = "";
        SQL += " SELECT NAME_ENG,SURNAME_ENG,EMAIL FROM PSST_PERSON WHERE NAME_ENG LIKE '" + NAME_ENG + "'";
        SqlDataAdapter DA = new SqlDataAdapter(SQL, DefaultConnectionString);
        DataTable DT = new DataTable();
        DA.Fill(DT);

        if (DT.Rows.Count > 0)
        {
            for (int i = 0; i <= DT.Rows.Count - 1; i++)
            {
                for (int j = 0; j <= SURNAME_ENG.Length - 1; j++)
                {
                    String NewEmail = NAME_ENG + "." + SURNAME_ENG.Substring(0, j + 1) + "@opm.go.th";
                    DT.DefaultView.RowFilter = " EMAIL LIKE '%" + NAME_ENG + "." + SURNAME_ENG.Substring(0, j + 1) + "@opm.go.th'";
                    if (DT.DefaultView.Count == 0)
                    {
                        Result.EMAIL = NewEmail;
                        break;
                    }

                }
            }
        }
        else
        {
            String NewEmail = NAME_ENG + "." + SURNAME_ENG.Substring(0, 1) + "@opm.go.th";
            Result.EMAIL = NewEmail;
        }

        return Result;
    }
Example #40
0
        private void saveUserButton_Click(object sender, EventArgs e)
        {
            try
            {
                userId.Focus();
                if (!this.Validate())
                {
                    return;
                }
                password.Focus();
                if (!this.Validate())
                {
                    return;
                }

                string fname, mname, lname, emailid, gender = "Male";
                DateTime Birthday;
                string Preffix = "";
                string Suffix = "";
                string empno;
                string Category = "";
                bool isActive;
                string Address1;
                string Address2;
                string City = "";
                string State = "";
                int Zipcode = '\0';
                int phoneNo = '\0';
                string Upin;
                string Npin;
                /*
                firstName.Focus();
                if (!this.Validate())
                {
                    return;
                }
                lastName.Focus();
                if (!this.Validate())
                {
                    return;
                }
                emailAddress.Focus();
                if (!this.Validate())
                {
                    return;
                }
                */
                //if(!string.IsNullOrEmpty(firstName.Text))
                    fname = firstName.Text;
                //if (!string.IsNullOrEmpty(middleName.Text))
                    mname = middleName.Text;
                //if (!string.IsNullOrEmpty(lastName.Text))
                    lname = lastName.Text;
                if (!string.IsNullOrEmpty(emailAddress.Text))
                    if (IsEmail(emailAddress.Text))
                        emailid = emailAddress.Text;
                    else
                    {
                        emailid = "";
                        MessageBox.Show("Invalid email address");
                    }
                else
                    emailid = "";
                if(prefixCombo.SelectedIndex >= 0)
                {
                    Preffix = prefixCombo.SelectedIndex.ToString();
                }
                if (suffixCombo.SelectedIndex >= 0)
                {
                    Suffix = suffixCombo.SelectedIndex.ToString();
                }
                empno = employeeno.Text;
                if (categoryCombo.SelectedIndex >= 0)
                {
                    Category = categoryCombo.SelectedIndex.ToString();
                }
                isActive = chkActive.Checked;
                Address1 = address1.Text;
                Address2 = address2.Text;
                if (cityCombo.SelectedIndex >= 0)
                {
                    City = cityCombo.SelectedItem.ToString();
                }
                if (stateCombo.SelectedIndex >= 0)
                {
                    State = stateCombo.SelectedItem.ToString();
                }
                if (!string.IsNullOrEmpty(telephoneno.Text) && (!Int32.TryParse(telephoneno.Text, out phoneNo)))
                {
                    MessageBox.Show("Phone No should be integer.");
                    return;
                }

                if (!string.IsNullOrEmpty(zipCode.Text) && !Int32.TryParse(zipCode.Text, out Zipcode))
                {
                    MessageBox.Show("Zipcode should be integer.");
                    return;
                }

                Npin = npin.Text;
                Upin = upin.Text;

                if (genderCombo.SelectedIndex >= 0)
                {
                    gender = genderCombo.SelectedItem.ToString();
                }
                Birthday = birthday.Value;
                PersonalInfo pi = new PersonalInfo(fname, mname, lname, emailid, birthday.Value, gender, Preffix, Suffix, empno, Category, isActive, Address1, Address2, City, State, Zipcode, phoneNo, Upin, Npin);
                string orgName = "",groupid = "";
                if (organizationCombobox.SelectedIndex >= 0)
                {
                    orgName = organizationCombobox.SelectedItem.ToString();
                }
                else
                {
                    MessageBox.Show("Select Organization.");
                    return;
                }
                if(groupCombobox.SelectedIndex >=0)
                {
                    groupid = groupCombobox.SelectedItem.ToString();
                }
                else
                {
                    MessageBox.Show("Select Group.");
                    return;
                }
                if (isEdited)
                {
                    //Checking if a user with same name exists
                    if (UserAdminUtilities.UserAdminUtility.Users.username.Contains(userId.Text))
                    {
                        UserAdminUtilities.UserAdminUtility.Users.Remove(currentUser);
                        UserAdminUtilities.UserAdminUtility.Users.Insert(currentUserIndex, User.CreateUser(userId.Text, pi, password.Text, orgName, groupid));
                        isSave = true;
                        this.Close();
                    }
                }
                else
                {
                    //Checking if a user with same name exists
                    if (!UserAdminUtilities.UserAdminUtility.Users.username.Contains(userId.Text))
                    {
                        UserAdminUtilities.UserAdminUtility.Users.Add(User.CreateUser(userId.Text, pi, password.Text, orgName, groupid));
                        isSave = true;
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("User with the same name already exists");
                    }
                }
                //isSave = true;
                //this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Example #41
0
 public PersonalInfo GetPersonalInfo()
 {
     PersonalInfo personalinfo = new PersonalInfo();
     return personalinfo;
 }
        /// <summary>
        /// Create user access
        /// </summary>
        /// <returns>access id</returns>
        public string CreateUserAccess(string userTitle, string userName, string userFirstname, string userPhoneNumber, string backUrl)
        {
            try
            {
                //#3- Ouverture d'un acces pour utilisateur
                //Data from certificate
                UserDN userDN = new UserDN()
                {
                    countryName = "FR",
                    organizationName = "UPSIDEO",
                    organizationalUnitName = "0002 538 768 003",
                    //emailAddress = "<Ne pas valoriser>",
                    commonName = "UPSIDEO", //<Prénom Nom>
                };

                SignatureInfo signatureInfo = new SignatureInfo()
                {
                    title = userTitle,
                    lastName = (!string.IsNullOrEmpty(userName)) ? userName : "******",
                    firstName = (!string.IsNullOrEmpty(userFirstname)) ? userFirstname : " ",
                    userDN = userDN
                };

                AuthenticationInfo authenticationInfo = new AuthenticationInfo()
                {
                    phoneNumber = this.GetCorrectDictaoMobile(userPhoneNumber),
                };

                string userId = System.Guid.NewGuid().ToString();

                PersonalInfo personalInfo = new PersonalInfo()
                {
                    userId = userId,
                    signatureInfo = signatureInfo,
                    authenticationInfo = authenticationInfo                    
                };

                //string consent = "J'ai bien lu les documents ci-contre que j'accepte de signer selon les termes des conditions générales et de la convention de preuve. J'ai connaissance du fait que la signature des documents au moyen d'une signature électronique manifeste mon consentement aux droits et obligations qui en découlent, au même titre qu'une signature manuscrite. J'accepte la ${TermAndConditionsUrl}."; // et la convention de preuve
                //Appendix doc
                List<string> appendixDocs = new List<string>();
                for (int i = 1; i <= AppendixCount; i++)
                {
                    appendixDocs.Add(string.Format("{0}{1}", APPENDIX, i));
                }

                createUserAccess createUserAccess = new createUserAccess()
                {
                    transactionId = TransactionId,
                    userInfo = personalInfo,
                    timeout = (long)3600000, //ms
                    userType = userId,
                    //authorizedDocTypes = new List<string>() { DocumentTypes.CONTRACT.ToString(), DocumentTypes.APPENDIX1.ToString(), DocumentTypes.APPENDIX2.ToString(), DocumentTypes.APPENDIX3.ToString() }.ToArray(), //TODO => list of appendixes : 3 appendixes
                    authorizedDocTypes = new List<string>() { DocumentTypes.CONTRACT.ToString() }.Concat(appendixDocs).ToArray(),
                    metadata = null
                };

                createUserAccessResponse createUserAccessResponse = _TransactionPortClient.createUserAccess(createUserAccess);
                string accessId = createUserAccessResponse.accessId;

                return accessId;
            }
            catch (Exception ex)
            {
                //string errorMessage = "Il est impossible de signer électroniquement votre document car le numéro de mobile indiqué n'est pas valide.";
                string errorMessage = ex.Message;

                if (!string.IsNullOrEmpty(errorMessage) && !errorMessage.Contains("mobile"))
                {
                    errorMessage = "Une erreur inattendue est survenue lors de la signature. Veuillez réessayer ultérieurement.";
                }
                              
                throw new Exception(errorMessage);
            }
        }
Example #43
0
        private PersonalTable(byte[] data, GameVersion format)
        {
            int size = 0;
            switch (format)
            {
                case GameVersion.RBY: size = PersonalInfoG1.SIZE; break;
                case GameVersion.GS:
                case GameVersion.C: size = PersonalInfoG2.SIZE; break;
                case GameVersion.RS:
                case GameVersion.E:
                case GameVersion.FR:
                case GameVersion.LG: size = PersonalInfoG3.SIZE; break;
                case GameVersion.DP:
                case GameVersion.Pt:
                case GameVersion.HGSS: size = PersonalInfoG4.SIZE; break;
                case GameVersion.BW: size = PersonalInfoBW.SIZE; break;
                case GameVersion.B2W2: size = PersonalInfoB2W2.SIZE; break;
                case GameVersion.XY: size = PersonalInfoXY.SIZE; break;
                case GameVersion.ORAS: size = PersonalInfoORAS.SIZE; break;
                case GameVersion.SM: size = PersonalInfoSM.SIZE; break;
            }

            if (size == 0)
            { Table = null; return; }

            byte[][] entries = splitBytes(data, size);
            PersonalInfo[] d = new PersonalInfo[data.Length / size];

            switch (format)
            {
                case GameVersion.RBY:
                    for (int i = 0; i < d.Length; i++)
                        d[i] = new PersonalInfoG1(entries[i]);
                    break;
                case GameVersion.GS:
                case GameVersion.C:
                    for (int i = 0; i < d.Length; i++)
                        d[i] = new PersonalInfoG2(entries[i]);
                    break;
                case GameVersion.RS:
                case GameVersion.E:
                case GameVersion.FR:
                case GameVersion.LG:
                    Array.Resize(ref d, 387);
                    for (int i = 0; i < d.Length; i++) // entries are not in order of natdexID
                        d[i] = new PersonalInfoG3(entries[PKX.getG3Species(i)]);
                    break;
                case GameVersion.DP:
                case GameVersion.Pt:
                case GameVersion.HGSS:
                    for (int i = 0; i < d.Length; i++)
                        d[i] = new PersonalInfoG4(entries[i]);
                    break;
                case GameVersion.BW:
                    for (int i = 0; i < d.Length; i++)
                        d[i] = new PersonalInfoBW(entries[i]);
                    break;
                case GameVersion.B2W2:
                    for (int i = 0; i < d.Length; i++)
                        d[i] = new PersonalInfoB2W2(entries[i]);
                    break;
                case GameVersion.XY:
                    for (int i = 0; i < d.Length; i++)
                        d[i] = new PersonalInfoXY(entries[i]);
                    break;
                case GameVersion.ORAS:
                    for (int i = 0; i < d.Length; i++)
                        d[i] = new PersonalInfoORAS(entries[i]);
                    break;
                case GameVersion.SM:
                    for (int i = 0; i < d.Length; i++)
                        d[i] = new PersonalInfoSM(entries[i]);
                    break;
            }
            Table = d;
        }
Example #44
0
        public void AssignSeat(int position, PersonalInfo attendee)
        {
            if (string.IsNullOrEmpty(attendee.Email))
                throw new ArgumentNullException("attendee.Email");

            SeatAssignment current;
            if (!this.seats.TryGetValue(position, out current))
                throw new ArgumentOutOfRangeException("position");

            if (!attendee.Email.Equals(current.Attendee.Email, StringComparison.InvariantCultureIgnoreCase))
            {
                if (current.Attendee.Email != null)
                {
                    this.Update(new SeatUnassigned(this.Id) { Position = position });
                }

                this.Update(new SeatAssigned(this.Id)
                {
                    Position = position,
                    SeatType = current.SeatType,
                    Attendee = attendee,
                });
            }
            else if (!string.Equals(attendee.FirstName, current.Attendee.FirstName, StringComparison.InvariantCultureIgnoreCase)
                || !string.Equals(attendee.LastName, current.Attendee.LastName, StringComparison.InvariantCultureIgnoreCase))
            {
                Update(new SeatAssignmentUpdated(this.Id)
                {
                    Position = position,
                    Attendee = attendee,
                });
            }
        }
Example #45
0
File: PKX.cs Project: kwsch/pk2pk
 internal static PersonalInfo[] getPersonalArray(byte[] data)
 {
     PersonalInfo[] d = new PersonalInfo[data.Length / PersonalInfo.Size];
     for (int i = 0; i < d.Length; i++)
         d[i] = new PersonalInfo(data.Skip(i*PersonalInfo.Size).Take(PersonalInfo.Size).ToArray());
     return d;
 }