Пример #1
0
        public Target_Setting Get_Setting()
        {
            Target_Setting target_Setting = new Target_Setting();

            dao             = new DAO(DBConnection.enConnectionType.SourceConnectionString);
            cmd             = new SqlCommand();
            cmd.CommandText = "select [SETTING_ID],[SETTING_NAME_VC],[SETTING_VALUE_VC],[SETTING_DESCRIPTION_VC] FROM [SETTINGS] where[SETTING_ID] in (16,18,19,108)";
            SqlDataReader sqlDataReader = dao.ExeDataReader(cmd);

            while (sqlDataReader.Read())
            {
                Int32 SETTING_ID;
                SETTING_ID = Convert.ToInt32(sqlDataReader["SETTING_ID"]);
                if (SETTING_ID == 16)
                {
                    target_Setting.RestaurantTitle = Convert.ToString(sqlDataReader["SETTING_VALUE_VC"]);
                }
                if (SETTING_ID == 18)
                {
                    target_Setting.RestaurantAddress = Convert.ToString(sqlDataReader["SETTING_VALUE_VC"]);
                }
                if (SETTING_ID == 19)
                {
                    target_Setting.Phone = Convert.ToString(sqlDataReader["SETTING_VALUE_VC"]);
                }
                if (SETTING_ID == 108)
                {
                    target_Setting.ResturantId = Convert.ToInt64(sqlDataReader["SETTING_VALUE_VC"]);
                }
            }

            return(target_Setting);
        }
Пример #2
0
        private void Fill_Resturant(DAL.Source.Target_Setting target_Setting)
        {
            txtPhone.Text             = target_Setting.Phone;
            txtRestaurantAddress.Text = target_Setting.RestaurantAddress;
            txtRestaurantTitle.Text   = target_Setting.RestaurantTitle;
            txtTwoPersonCost.Text     = target_Setting.TwoPersonCost.ToString();
            txtX.Text            = target_Setting.X;
            txtY.Text            = target_Setting.Y;
            txtRestaurantId.Text = target_Setting.ResturantId.ToString();

            chkHasHealthyFood.Checked = target_Setting.HasHealthyFood;

            chkHasHokan.Checked   = target_Setting.HasHokan;
            chkHasParking.Checked = target_Setting.HasParking;

            chkHasSeaFood.Checked = target_Setting.HasSeaFood;
        }