Exemple #1
0
        private void RunUserSearches(UserCredential userCredential)
        {
            TransferHelper helper = new TransferHelper(userCredential);

            while (GetUserStatus(userCredential.Id) == "Loggedin Successfully")
            {
                try
                {
                    foreach (var search in userCredential.PlayerSearchCriterias)
                    {
                        if (search.ABSetting == null && search.SettingId != null)
                        {
                            search.ABSetting = SettingDAL.GetSetting(search.SettingId);
                        }
                        if (!string.IsNullOrEmpty(search.ABSetting.BuyPrice))
                        {
                            helper.SnipeCard(search);
                        }

                        if (search.ABSetting.SellTransferList)
                        {
                            helper.SellCards();
                        }
                    }
                }
                catch (Exception)
                {
                    continue;
                }
            }
        }
        public async Task <HttpResponseMessage> ForgotPasswordConfrim(string AspNetUserID, string Code)
        {
            try
            {
                SettingDAL   dal      = new SettingDAL();
                JsonResponse response = await dal.ForgotPasswordConfrim(AspNetUserID, Code);

                if (response != null && response.Flag)
                {
                    return(Request.CreateResponse <JsonResponse>(HttpStatusCode.OK, response));
                }
                else
                {
                    return(Request.CreateErrorResponse(HttpStatusCode.NotFound, MIUWebAPI.Helper.Constants.ErrorNotFound));
                }
            }
            catch (DbEntityValidationException ex)
            {
                var    controllerName = ControllerContext.RouteData.Values["controller"].ToString();
                var    actionName     = ControllerContext.RouteData.Values["action"].ToString();
                Logger log            = new Logger();
                log.ErrorLog(ex, controllerName, actionName);
                return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, MIUWebAPI.Helper.Constants.ErrorSysError));
            }
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            cbDepartment.ItemsSource  = DepartmentDAL.ListALL();
            cbEducation.ItemsSource   = IdNameDAL.GetByCatagory("学历");
            cbGender.ItemsSource      = IdNameDAL.GetByCatagory("性别");
            cbMarriage.ItemsSource    = IdNameDAL.GetByCatagory("婚姻状况");
            cbPartyStatus.ItemsSource = IdNameDAL.GetByCatagory("政治面貌");
            if (IsAddNew)
            {
                Employee employee = new Employee();
                employee.InDate           = DateTime.Today;
                employee.ContractStartDay = DateTime.Today;
                employee.ContractEndDay   = DateTime.Today.AddYears(1);
                employee.Nationality      = "汉族";
                employee.Email            = "*****@*****.**";
                //employee.Number = "Ideas";
                employee.Number          = SettingDAL.GetValue("员工工号前缀");
                gridEmployee.DataContext = employee;
            }
            else
            {
                Employee employee = EmployeeDAL.GetById(EditingId);
                gridEmployee.DataContext = employee;

                if (employee.Photo != null)
                {
                    ShowImage(employee.Photo);
                }
            }
        }
Exemple #4
0
 private void ConfigForm_Load(object sender, EventArgs e)
 {
     setting      = SettingDAL.GetSetting();
     lightcontrol = LightConrolDAL.GetLights();
     LayoutIni(setting, lightcontrol);
     LLSDK.WinAPI.Window.SetWindowAlwaysTop(this.Handle);
 }
        private void btn_editSave_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txt_settingSaveName.Text))
            {
                MessageBox.Show("Setting Name Required");
                return;
            }

            ABSetting setting = GetSettingsFromForm();

            if (grd_settingsList.SelectedRows.Count > 0)
            {
                object pkId = grd_settingsList.SelectedRows[0].Cells["PkId"].Value;
                setting.PkId = Convert.ToInt32(pkId);
                SettingDAL.UpdateSetting(setting);
            }
            else
            {
                SettingDAL.SaveSetting(setting);
            }

            SettingList_Load(sender, e);

            HideSettingForm();
        }
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     txtCompanyName.Text             = SettingDAL.GetValue("公司名称");
     txtCompanySite.Text             = SettingDAL.GetValue("公司网站");
     txtBirthdayCount.Text           = SettingDAL.GetValue("生日提醒天数");
     cbStartBirthdayRemind.IsChecked = SettingDAL.GetBoolValue("启用生日提醒");
     txtNumberPrefix.Text            = SettingDAL.GetValue("员工工号前缀");
 }
Exemple #7
0
        /// <summary>
        ///     保存登录信息
        /// </summary>
        private void SaveLoginSetting()
        {
            var localSetting = Config.LocalSetting;
            var testSetting  = (TestOption)AppSettings["DefaultTestOption"];

            localSetting.DefaultTestOption       = testSetting;
            localSetting.ScriptErrorsSuppressed  = (bool)AppSettings["ScriptErrorsSuppressed"];
            localSetting.AutoChangeProxyInterval = (int)AppSettings["AutoChangeProxyInterval"];
            localSetting.TestTimeOut             = (int)AppSettings["TestTimeOut"];
            localSetting.TestThreadsCount        = (int)AppSettings["TestThreadsCount"];
            localSetting.AutoProxySpeed          = (int)AppSettings["AutoProxySpeed"];
            localSetting.ExportMode       = (string)AppSettings["ExportMode"];
            localSetting.IsUseSystemProxy = (bool)AppSettings["IsUseSystemProxy"];
            localSetting.LanguageFileName = (string)AppSettings["LanguageFileName"];
            localSetting.UserAgent        = string.IsNullOrEmpty((string)AppSettings["UserAgent"])
                                                 ? "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)"
                                                 : (string)AppSettings["UserAgent"];
            var dal   = new SettingDAL();
            var model = dal.FindAll().FirstOrDefault();
            var res   = 0;

            if (model == null)
            {
                res = dal.Insert(localSetting);
            }
            else
            {
                TestOption searchSetting = model.TestOptionsList.FirstOrDefault(temp => temp.TestUrl == testSetting.TestUrl);

                if (searchSetting != null && searchSetting.TestUrl != "")
                {
                    if (searchSetting.TestUrl == testSetting.TestUrl) //如果已经设置,则移除换成新的
                    {
                        model.TestOptionsList.Remove(searchSetting);
                        model.DefaultTestOption        = testSetting;
                        localSetting.DefaultTestOption = testSetting;
                    }
                }

                if (!model.TestOptionsList.Any(te => te.TestUrl.ToLower() == testSetting.TestUrl.ToLower()))
                {
                    model.TestOptionsList.Add(testSetting);
                }

                localSetting.TestOptionsList = model.TestOptionsList;


                localSetting.Id = model.Id;
                res             = dal.Update(localSetting) ? 1 : 0;
            }

            if (res == 0)
            {
                MsgBox.ShowErrorMessage("保存失败!");
            }
        }
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            SettingDAL.SetValue("公司名称", txtCompanyName.Text);
            SettingDAL.SetValue("公司网站", txtCompanySite.Text);
            SettingDAL.SetValue("生日提醒天数", txtBirthdayCount.Text);
            SettingDAL.SetValue("员工工号前缀", txtNumberPrefix.Text);
            SettingDAL.SetValue("启用生日提醒", (bool)cbStartBirthdayRemind.IsChecked);

            DialogResult = true;
        }
Exemple #9
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            SettingDAL dal = new SettingDAL();

            txtCompanyName.Text          = dal.GetValue("公司名称");
            txtCompanySite.Text          = dal.GetValue("公司网站");
            cbBirthDayPrompt.IsChecked   = dal.GetBoolValue("启用生日提醒");
            txtBirthDayDays.Text         = dal.GetValue("生日提醒天数");
            txtEmployeeNumberPrefix.Text = dal.GetValue("员工工号前缀");
        }
        private void btn_deleteSetting_Click(object sender, EventArgs e)
        {
            if (grd_settingsList.SelectedRows.Count > 0)
            {
                object pkId = grd_settingsList.SelectedRows[0].Cells["PkId"].Value;
                SettingDAL.DeleteSetting(pkId);

                SettingList_Load(sender, e);
            }
            HideSettingForm();
        }
        private void btn_editSetting_Click(object sender, EventArgs e)
        {
            if (grd_settingsList.SelectedRows.Count > 0)
            {
                object    pkId    = grd_settingsList.SelectedRows[0].Cells["PkId"].Value;
                ABSetting setting = SettingDAL.GetSetting(pkId);

                FillFormFormSetting(setting);
            }

            ShowSettingForm();
        }
Exemple #12
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            SettingDAL dal = new SettingDAL();

            dal.SetValue("公司名称", txtCompanyName.Text);
            dal.SetValue("公司网站", txtCompanySite.Text);
            dal.SetValue("启用生日提醒", (bool)cbBirthDayPrompt.IsChecked);
            dal.SetValue("生日提醒天数", txtBirthDayDays.Text);
            dal.SetValue("员工工号前缀", txtEmployeeNumberPrefix.Text);

            DialogResult = true;
        }
Exemple #13
0
        private void btnOpen_Click(object sender, EventArgs e)
        {
            try
            {
                var path = Config.LanguagePath;
                if (!Config.IsChineseOs) //如果不是中文操作系统
                {
                    if (!File.Exists(Path.Combine(path, "English.xml")))
                    {
                        path = Path.Combine(Application.StartupPath, "Languages");
                    }
                }

                var objOpen = new OpenFileDialog
                {
                    Filter           = @"(*.xml)|*.xml|(*.*)|*.*",
                    InitialDirectory = path
                };

                if (objOpen.ShowDialog() == DialogResult.OK)
                {
                    txtLanguageFile.Text = objOpen.FileName;
                    var language = XmlHelper.XmlDeserialize(
                        objOpen.FileName,
                        typeof(Language)) as Language;

                    if (language != null)
                    {
                        lblForLPHVersion.Text       = language.LanguageFileForLPHVersion;
                        lblLanguageFileAuthor.Text  = language.LanguageFileAuthor;
                        lblLanguageFileVersion.Text = language.LanguageFileVersion;
                        lblLanguageName.Text        = language.LanguageName;

                        LoadLanguage(language);
                    }
                    var dal   = new SettingDAL();
                    var model = dal.FindAll().FirstOrDefault();
                    if (model != null)
                    {
                        model.LanguageFileName = objOpen.FileName;
                        dal.Update(model);
                    }

                    ApplicationMustRestart = true;
                }
            }
            catch (Exception ex)
            {
                MsgBox.ShowExceptionMessage(ex);
            }
        }
        private void SettingList_Load(object sender, EventArgs e)
        {
            List <ABSetting> settings = SettingDAL.GetSettings();

            grd_settingsList.DataSource = settings.ToDataTable();

            if (settings.Any())
            {
                lbl_noSettings.Visible   = false;
                grd_settingsList.Visible = true;
            }
            else
            {
                lbl_noSettings.Visible   = true;
                grd_settingsList.Visible = false;
            }
        }
Exemple #15
0
        private void skinButtonConfirm_Click(object sender, EventArgs e)
        {
            string tmpRec = string.Format("{0},{1},{2},{3}", skinTextBoxXpos.Text, skinTextBoxYpos.Text, skinTextBoxWidth.Text, skinTextBoxHeight.Text);

            setting.ClientRec      = (Rectangle) new RectangleConverter().ConvertFromString(tmpRec);
            lightcontrol.Enable    = lightEnable.Checked;
            lightcontrol.NormState = skinComboBoxState.Text;
            lightcontrol.Address   = skinTextBoxChipID.Text;
            lightcontrol.RemoteIP  = skinTextBoxIP.Text;
            lightcontrol.StrPorts  = skinTextBoxPorts.Text;

            setting.Port    = int.Parse(skinTextBoxListenPort.Text);
            setting.CirPlay = skinComboBoxCirPlay.Text == "是"?true:false;
            setting.HideCur = skinComboBoxHideCur.Text == "是"?true:false;
            SettingDAL.UpdateSetting(setting);
            LightConrolDAL.UpdateLights(lightcontrol);

            Application.Restart();
        }
        public SearchList()
        {
            InitializeComponent();
            HideSearchForm();
            cmb_srchPlayerQuality.DataSource = DropDownHelper.GetQualities();
            cmb_srchPlayerRarity.DataSource  = DropDownHelper.GetRarities();
            cmb_srchPlayerLeague.DataSource  = DropDownHelper.GetLeagues();
            cmb_srchPlayerClub.DataSource    = DropDownHelper.GetClubs();

            var abSettings = new List <DropDownOption>
            {
                new DropDownOption {
                    Id = -1, DisplayValue = "-- AB Setting --"
                }
            };

            abSettings.AddRange(SettingDAL.GetSettings().Select(a => new DropDownOption {
                Id = a.PkId, DisplayValue = a.Name
            }));
            cmb_abSettings.DataSource = abSettings;

            ac_playerName.DataSource = SearchDAL.GetPlayersForAutoSuggest().Select(a => a.DisplayName).Distinct().ToList();
        }
Exemple #17
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            //Login lg = new Login();
            //if (lg.ShowDialog() != true)
            //{
            //    Application.Current.Shutdown();
            //}

            this.Title = SettingDAL.GetValue("公司名称") + "人事管理系统";

            //查询是否有员工过生日

            int month = DateTime.Now.Month;
            int day   = DateTime.Now.Day;

            if (SettingDAL.GetBoolValue("启用生日提醒"))
            {
                List <Employee> list = EmployeeDAL.ListAll().ToList();
                foreach (Employee item in list)
                {
                    int empMonth = item.BirthDay.Month;
                    int empDay   = item.BirthDay.Day;
                    if (month == empMonth && empDay == day)
                    {
                        MessageBox.Show("今天是你的同事" + item.Name + "的生日,赶快送上祝福吧!");
                        continue;
                    }

                    if (month == empMonth && (empDay - day) <= SettingDAL.GetIntValue("生日提醒天数") && (empDay - day) > 0)//有人要过生日
                    {
                        MessageBox.Show("还有" + (empDay - day) + "天是你的同事" + item.Name + "的生日,赶快送上祝福吧!");
                        continue;
                    }
                }
            }
        }
        public async Task <HttpResponseMessage> PasswordChange(ChangePassword req)
        {
            try
            {
                SettingDAL dal = new SettingDAL();
                //JsonResponse response = await PasswordChanges(req);
                JsonResponse response = new JsonResponse();
                using (MIUEntities db = new MIUEntities())
                {
                    try
                    {
                        User user = db.Users.Where(x => x.ID == req.UserID).FirstOrDefault();
                        if (user == null)
                        {
                            response.Flag    = true;
                            response.Message = "User not found.";
                        }
                        else
                        {
                            string Message = "";
                            if (user.Password == req.CurrentPassword)
                            {
                                if (req.NewPassword == req.ComfirmPassword)
                                {
                                    user.Password = req.NewPassword;
                                    var            AspNetUserID = db.AspNetUsers.Where(x => x.UserName == user.LoginName).Select(x => x.Id).FirstOrDefault();
                                    IdentityResult result       = await UserManager.ChangePasswordAsync(AspNetUserID, req.CurrentPassword, req.NewPassword);

                                    if (!result.Succeeded)
                                    {
                                        Message = "Fail to change password!";
                                    }
                                    else
                                    {
                                        db.SaveChanges();
                                        Message = "Update Password Successfully!.";
                                    }
                                }
                                else
                                {
                                    Message = "New password and confirm password are not same.";
                                }
                            }
                            else
                            {
                                Message = "Current Password is incorrect.";
                            }
                            //db.SaveChanges();
                            response.Flag    = true;
                            response.Message = Message;
                        }
                    }
                    catch (Exception ex)
                    {
                        //return new JsonResponse() { Flag = true, Message = Message };
                        response.Flag    = true;
                        response.Message = ex.Message;
                    }
                }
                if (response != null && response.Flag)
                //if (response)
                {
                    return(Request.CreateResponse <JsonResponse>(HttpStatusCode.OK, response));
                }
                else
                {
                    return(Request.CreateErrorResponse(HttpStatusCode.NotFound, MIUWebAPI.Helper.Constants.ErrorNotFound));
                }
            }
            catch (DbEntityValidationException ex)
            {
                var    controllerName = ControllerContext.RouteData.Values["controller"].ToString();
                var    actionName     = ControllerContext.RouteData.Values["action"].ToString();
                Logger log            = new Logger();
                log.ErrorLog(ex, controllerName, actionName);
                return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, MIUWebAPI.Helper.Constants.ErrorSysError));
            }
        }
Exemple #19
0
        public ActionResult AddMenu()
        {
            var model = new SettingDAL().GetListMenu();

            return(View());
        }
Exemple #20
0
 public MediaController(APlayer player) : base(player)
 {
     setting      = SettingDAL.GetSetting();
     lightcontrol = LightConrolDAL.GetLights();
 }