예제 #1
0
        public static void FillDataGrid(ClientPage form)
        {
            //инициилизация датагрида
            DataGridView dtv = new DataGridView();

            //установка свойств дата грида
            dtv.RowHeadersVisible   = false;
            dtv.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
            dtv.Size                  = new Size(340, 139);
            dtv.Location              = new Point(332, 172);
            dtv.AllowUserToAddRows    = false;
            dtv.AllowUserToDeleteRows = false;
            dtv.ReadOnly              = true;

            DataSet   ds = InteractionDB.FillDataGrid(Client.getInstance().ID);
            DataTable dt = ds.Tables[0];

            dt.Columns[0].ColumnName = "Тип кредита";
            dt.Columns[1].ColumnName = "Полученный балл";
            dt.Columns[2].ColumnName = "Результат";
            dtv.DataSource           = dt;
            dtv.CellFormatting      += Dtv_CellFormatting;

            /*     for (int i = 0; i < dtv.Rows.Count; i++)
             *   {
             *       if (dtv.Rows[i].Cells[2].Value.ToString() == "Yes")
             *           dtv.Rows[i].DefaultCellStyle.BackColor = Color.Green;
             *       else dtv.Rows[i].DefaultCellStyle.BackColor = Color.Red;
             *   } */


            form.Controls.Add(dtv);
            //  dtv.Rows.RemoveAt(dtv.Rows.Count - 2);
        }
예제 #2
0
 private static void SetResult()
 {
     if (TotalSum >= NeededSum)
     {
         Result = "Одобрено";
     }
     else
     {
         Result = "Отклонено";
     }
     InteractionDB.InsertResult(ClientId, TotalSum, CreditType, Result);
 }
예제 #3
0
        public static void CheckIndex()
        {
            bool   CheckResult;
            Client client = Client.getInstance();

            CheckResult = InteractionDB.CheckIndex(client.Index);
            if (CheckResult)
            {
                return;
            }
            else
            {
                TotalSum -= 10000;
            }
        }
예제 #4
0
        /// <summary>
        /// Логин и пароль отправляется на проверку наличие в базе данных в класс InteractionDB
        /// В случае положительного результата производится заполнение класса Client данными из запроса (InteractionDB.StringResult)
        /// </summary>
        /// <param name="gLogin"></param>
        /// <param name="gPass"></param>
        /// <returns>Возвращает true, если логин и пароль находятся в базе данных</returns>
        static public bool Enter(TextBox gLogin, TextBox gPass)
        {
            bool IsEntered;

            Login = gLogin.Text;
            Pass  = gPass.Text;

            IsEntered = InteractionDB.IsExists(Login, Pass);
            if (IsEntered)
            {
                Client cl = Client.getInstance();
                cl.FillInstance(InteractionDB.StringResult);
            }
            return(IsEntered);
        }
예제 #5
0
        public static void CheckPhoneCode()
        {
            bool   CheckResult;
            Client client    = Client.getInstance();
            string Phone     = client.HomePhoneNumber;
            string PhoneCode = Phone.Substring(1, 5);

            CheckResult = InteractionDB.CheckPhoneCode(PhoneCode);
            if (CheckResult)
            {
                return;
            }
            else
            {
                TotalSum -= 10000;
            }
        }
예제 #6
0
        /// <summary>
        /// Создание строки sqlstatement
        /// </summary>
        /// <param name="gLogin"></param>
        /// <param name="gPassword"></param>
        /// <param name="gSurname"></param>
        /// <param name="gFirstName"></param>
        /// <param name="gPatronymic"></param>
        /// <param name="gDateOfBirth"></param>
        /// <param name="gPlaceOfBirth"></param>
        /// <param name="gINN"></param>
        /// <param name="gGender"></param>
        /// <param name="gPassportSeries"></param>
        /// <param name="gPassportNumber"></param>
        /// <param name="gPassportDate"></param>
        /// <param name="gPassportCode"></param>
        /// <param name="gPassportPlace"></param>
        /// <param name="gPhoneNumber"></param>
        /// <param name="gHomePhoneNumber"></param>
        /// <param name="gEmail"></param>
        /// <param name="gEducation"></param>
        /// <param name="gFamilyInstance"></param>
        /// <param name="gAdressIndex"></param>
        /// <param name="gAdressRegion"></param>
        /// <param name="gAdressArea"></param>
        /// <param name="gCity"></param>
        public void CreateSQLQuery(string gLogin, string gPassword, string gSurname, string gFirstName, string gPatronymic,
                                   DateTime gDateOfBirth, string gPlaceOfBirth, string gINN, string gGender, string gPassportSeries, string gPassportNumber,
                                   DateTime gPassportDate, string gPassportCode, string gPassportPlace, string gPhoneNumber, string gHomePhoneNumber,
                                   string gEmail, string gEducation, string gFamilyInstance, string gAdressIndex, string gAdressRegion, string gAdressArea, string gCity)
        {
            sqlstatement += "'" + InteractionDB.CountNextID().ToString() + "',";
            sqlstatement += "'" + gLogin + "',";
            sqlstatement += "'" + gPassword + "',";
            sqlstatement += "'" + gSurname + "',";
            sqlstatement += "'" + gFirstName + "',";
            sqlstatement += "'" + gPatronymic + "',";

            string sqldateofbirth = gDateOfBirth.Year.ToString() + "/" + gDateOfBirth.Month.ToString() + "/" + gDateOfBirth.Day.ToString();

            sqlstatement += "'" + sqldateofbirth + "',";

            sqlstatement += "'" + gPlaceOfBirth + "',";
            sqlstatement += "'" + gINN + "',";
            sqlstatement += "'" + gGender + "',";
            sqlstatement += "'" + gPassportSeries + "',";
            sqlstatement += "'" + gPassportNumber + "',";

            string sqlpassportdate = gPassportDate.Year.ToString() + "/" + gPassportDate.Month.ToString() + "/" + gPassportDate.Day.ToString();

            sqlstatement += "'" + sqlpassportdate + "',";

            sqlstatement += "'" + gPassportCode + "',";
            sqlstatement += "'" + gPassportPlace + "',";
            sqlstatement += "'" + gPhoneNumber + "',";
            sqlstatement += "'" + gHomePhoneNumber + "',";
            sqlstatement += "'" + gEmail + "',";
            sqlstatement += "'" + gEducation + "',";
            sqlstatement += "'" + gFamilyInstance + "',";
            sqlstatement += "'" + gAdressIndex + "',";
            sqlstatement += "'" + gAdressRegion + "',";
            sqlstatement += "'" + gAdressArea + "',";
            sqlstatement += "'" + gCity + "'";
            sqlstatement  = "INSERT INTO CLIENT VALUES (" + sqlstatement + ")";
        }
예제 #7
0
 private static void GetNeededSum()
 {
     NeededSum = InteractionDB.GetTheNeededBall(CreditType);
     SetResult();
 }
예제 #8
0
 /// <summary>
 /// Установка описания кредита
 /// </summary>
 /// <param name="curCount"></param>
 private void GetInfo(int curCount)
 {
     CreditName        = InteractionDB.GetCreditName(count);
     CreditDescription = InteractionDB.GetDescriptionText(count);
 }
예제 #9
0
 /// <summary>
 /// Установка общего количества кредитов
 /// </summary>
 private void SetUpMaxCount()
 {
     maxCount = InteractionDB.CountCreditTypes() - 1;
 }