示例#1
0
 internal static void Postfix(Btd6Player __instance, ref bool __state)
 {
     if (__state)
     {
         ProfileManagement.UnCleanProfile(__instance.Data);
     }
 }
        public JsonResult SaveProfile(ProfileManagement _obj)
        {
            string counts = "";

            try
            {
                if (ModelState.IsValid)
                {
                    SIIRepository.Adminservice.DashboardRepository objRepository = new SIIRepository.Adminservice.DashboardRepository();
                    _obj.IP        = Request.ServerVariables["REMOTE_ADDR"].ToString();
                    _obj.updatedBy = Session["User_Name"].ToString();
                    DataSet _ds = objRepository.INSERT_STUDENT_DATA_FOREDIT(_obj);
                    if (_ds != null)
                    {
                        if (_ds.Tables[0].Rows.Count > 0)
                        {
                            counts = (_ds.Tables[0].Rows[0]["counts"].ToString());
                        }
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }

            return(Json(new
            {
                count = counts
            },
                        JsonRequestBehavior.AllowGet
                        ));
        }
        public ActionResult Delete()
        {
            ViewBag.Message = "Profile Delete";

            ProfileManagement request = new ProfileManagement(ApiKey)
            {
                ExternalProfileID = "testprofile"
            };

            request.PrepareDeleteRequest();

            string       response;
            bool         success = request.SendRequest(SharedKey, out response);
            SuccessModel model   = new SuccessModel();
            dynamic      result  = JsonConvert.DeserializeObject(response);

            if (success)
            {
                model.UnencryptedData = JsonConvert.SerializeObject(result, Formatting.Indented);
            }
            else
            {
                TempData.Add("error", JsonConvert.SerializeObject(result, Formatting.Indented));
            }

            return(View(model));
        }
        public JsonResult SELECT_EDITPROFILE()
        {
            SIIRepository.Adminservice.DashboardRepository _objRepository = new SIIRepository.Adminservice.DashboardRepository();
            string IP = "?";

            IP = Request.ServerVariables["REMOTE_ADDR"].ToString();
            DataSet ds = _objRepository.SELECT_STUDENT_DATA_FOREDIT(TempData.Peek("StudentID").ToString());
            List <ProfileManagement> _list = new List <ProfileManagement>();

            if (ds != null)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow _dr in ds.Tables[0].Rows)
                    {
                        ProfileManagement _obj = new ProfileManagement();
                        _obj.FirstName   = _dr["FirstName"].ToString();
                        _obj.MiddleName  = _dr["MiddleName"].ToString();
                        _obj.LastName    = _dr["LastName"].ToString();
                        _obj.Email       = _dr["Email"].ToString();
                        _obj.Mobile      = _dr["Mobile"].ToString();
                        _obj.DateOfBirth = _dr["DateOfBirth"].ToString();
                        _obj.StudentID   = _dr["StudentID"].ToString();
                        _obj.Country     = _dr["Country"].ToString();
                        _list.Add(_obj);
                    }
                }
            }
            return(Json(new
            {
                List = _list
            },
                        JsonRequestBehavior.AllowGet
                        ));
        }
    public void deleteProfile()
    {
        string         name           = profileDrop.options[profileDrop.value].text;
        CurrentProfile currentProfile = GameObject.Find("CurrentProfile").GetComponent <CurrentProfile>();

        ProfileManagement.RemoveProfile(name);
        dropDownUpdate();
    }
示例#6
0
 internal static bool Prefix(Btd6Player __instance, ref bool __state)
 {
     __state = __instance.IsPendingSave;
     if (__state)
     {
         ProfileManagement.CleanCurrentProfile(__instance.Data);
     }
     return(true);
 }
示例#7
0
 public bool isCalculRecord(int score)
 {
     if (profile.calculBestScore < score)
     {
         ProfileManagement.UpdateProfile(profile.name, score, profile.tableBestScore);
         newRecordText.text = "Bravo " + profile.name + " ! Nouveau record !";
         return(true);
     }
     return(false);
 }
 public void selectProfile()
 {
     try
     {
         string         name           = profileDrop.options[profileDrop.value].text;
         CurrentProfile currentProfile = GameObject.Find("CurrentProfile").GetComponent <CurrentProfile>();
         currentProfile.profile = ProfileManagement.LoadProfile(name);
         profileMenu.SetActive(false);
         GameModeMenu.SetActive(true);
     }
     catch
     {
         StartCoroutine(EmptyName(5.0f));
     }
 }
    void dropDownUpdate()
    {
        ExistingProfiles existProfiles = ProfileManagement.LoadAllProfiles();

        profileDrop.options.Clear();
        if (existProfiles != null)
        {
            List <string> profileNames = new List <string>();
            //Debug.Log("EXIST "+existProfiles);
            foreach (ProfileData profile in existProfiles.profiles)
            {
                profileNames.Add(profile.name);
                //Debug.Log("Profile FOUND "+profile.name);
            }
            profileDrop.AddOptions(profileNames);
        }
    }
        public DataSet INSERT_STUDENT_DATA_FOREDIT(ProfileManagement _obj)
        {
            try
            {
                _cn.Open();
                SqlCommand _cmd = new SqlCommand("INSERT_STUDENT_DATA_FOREDIT", _cn);
                _cmd.Parameters.AddWithValue("@StudentID", _obj.StudentID);
                _cmd.Parameters.AddWithValue("@FirstName", _obj.FirstName);
                _cmd.Parameters.AddWithValue("@MiddleName", _obj.MiddleName);
                _cmd.Parameters.AddWithValue("@LastName", _obj.LastName);

                if (_obj.DateOfBirth == null || _obj.DateOfBirth.Equals(""))
                {
                    _cmd.Parameters.AddWithValue("@DateOfBirth", DBNull.Value);
                }
                else
                {
                    _cmd.Parameters.AddWithValue("@DateOfBirth", DateTime.ParseExact(_obj.DateOfBirth.ToString(), "dd-MM-yyyy", null));
                }
                _cmd.Parameters.AddWithValue("@Email", _obj.Email);
                _cmd.Parameters.AddWithValue("@Mobile", _obj.Mobile);
                _cmd.Parameters.AddWithValue("@Country", _obj.Country);
                _cmd.Parameters.AddWithValue("@updatedBy", _obj.updatedBy);
                _cmd.Parameters.AddWithValue("@IP", _obj.IP);
                _cmd.CommandType    = CommandType.StoredProcedure;
                _cmd.CommandTimeout = 600;
                SqlDataAdapter _adp = new SqlDataAdapter(_cmd);
                DataSet        _ds  = new DataSet();
                _adp.Fill(_ds);
                _adp.Dispose();
                _cmd.Dispose();
                return(_ds);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                _cn.Close(); _cn.Dispose();
            }
        }
        public ActionResult Create()
        {
            ViewBag.Message = "Profile Create";

            ProfileManagement request = new ProfileManagement(ApiKey)
            {
                AcceptCanadianVisaDebit = true,
                AcceptedRegions         = new List <string>()
                {
                    "US"
                },
                BillingCountries         = BillingCountries.US | BillingCountries.AU,
                CardBrands               = SupportedCards.VISA | SupportedCards.AMEX | SupportedCards.DISCOVER | SupportedCards.MASTERCARD,
                CollectShipping          = true,
                CustomerSupportUrl       = new Uri("http://www.test.com"),
                DefaultProfile           = false,
                ExternalProfileID        = "testprofile",
                LogoDisplayName          = "display name",
                LogoUrl                  = new Uri("http://www.test.com"),
                ThreeDSActive            = false,
                ThreeDSSuppressChallenge = false,
                WebsiteUrl               = new Uri("http://www.test.com")
            };

            request.PrepareCreateRequest();

            string       response;
            bool         success = request.SendRequest(SharedKey, out response);
            SuccessModel model   = new SuccessModel();
            dynamic      result  = JsonConvert.DeserializeObject(response);

            if (success)
            {
                model.UnencryptedData = JsonConvert.SerializeObject(result, Formatting.Indented);
            }
            else
            {
                TempData.Add("error", JsonConvert.SerializeObject(result, Formatting.Indented));
            }

            return(View(model));
        }
示例#12
0
        async void LoadingSettings()
        {
            ProfilesAvaloniaObjList.ListProfilesuAvalonObj_Settings = new List <ProfileXamarinObj>();
            try
            {
                AddingExistingSettingsProfiles();

                var profiles = await Settings.GetProfiles(XamarinPatch);



                if (profiles.Count == 0)
                {
                    SettingsData settingsData = new SettingsData();

                    settingsData.NameProfile = ProfileManagement.GetRandomProfileName();



                    SetSetting(settingsData);
                }
                else if (profiles.Count > 0 & ProfileManagement.GlobalSelectedProfile == default)
                {
                    var settings = await Settings.Get(profiles[0].NameProfile, XamarinPatch);

                    ProfileManagement.SelectProfile(ProfilesAvaloniaObjList.ListProfilesuAvalonObj_Settings, profiles[0].NameProfile);

                    SetSetting(settings);
                }
                else
                {
                    var settings = await Settings.Get(ProfileManagement.GlobalSelectedProfile, XamarinPatch);

                    ProfileManagement.SelectProfile(ProfilesAvaloniaObjList.ListProfilesuAvalonObj_Settings, ProfileManagement.GlobalSelectedProfile);

                    SetSetting(settings);
                }
            }
示例#13
0
        private ConnectionData LoadProfile()
        {
            var profileManager = new ProfileManagement();
            var connectionData = new ConnectionData();

            var dialogResult = new Result();

            openFileDialog1.FileName         = "";
            openFileDialog1.InitialDirectory = @"C:\Documents";
            openFileDialog1.Filter           = Resources.FireManager_LoadProfile_Firebird_Profile_File____XML____XML;
            var openDialogResult = openFileDialog1.ShowDialog();

            if (openDialogResult == DialogResult.OK)
            {
                var filePath = openFileDialog1.FileName;

                connectionData = profileManager.GetSavedProfile(filePath);

                SetTreeValues(connectionData);
            }

            return(connectionData);
        }
 internal static bool Prefix(Btd6Player __instance)
 {
     ProfileManagement.CleanCurrentProfile(__instance.Data);
     return(true);
 }
 internal static void Prefix(ProfileModel __instance)
 {
     ProfileManagement.CleanPastProfile(__instance);
 }