예제 #1
0
        public Form_edit_vehicle_model(int int_group = 0, int int_model = 0)
        {
            InitializeComponent();

            cmb_brand.DisplayMember = "display";
            cmb_brand.ValueMember   = "value";
            cmb_brand.DataSource    = Combobox_options_ds.Option_vehicle_brand();

            cmb_fuel_type.DisplayMember = "display";
            cmb_fuel_type.ValueMember   = "value";
            cmb_fuel_type.DataSource    = Combobox_options_ds.Select_fuel_type();

            cmb_transmission.DisplayMember = "display";
            cmb_transmission.ValueMember   = "value";
            cmb_transmission.DataSource    = Combobox_options_ds.Select_transmission();

            if (int_group != 0)
            {
                Vehicle_brand_ds.vehicle_brandDataTable dttable_brand = Vehicle_brand_ds.Select_veh_brand_by_veh_group(int_group);

                if (dttable_brand.Rows.Count > 0)
                {
                    cmb_brand.SelectedValue = dttable_brand.Rows[0]["vehicle_brand"];
                }

                cmb_group.SelectedValue = int_group;
            }
            if (int_model != 0)
            {
                Model_id = int_model;
                Vehicle_model_ds.sp_select_vehicle_modelDataTable dttable = Vehicle_model_ds.
                                                                            Select_vehicle_model(-1, -1, -1, int_model);

                if (dttable.Rows.Count > 0)
                {
                    _str_ori_edit_model_name       = dttable.Rows[0]["vehicle_model_name"].ToString();
                    txt_model_name.Text            = dttable.Rows[0]["vehicle_model_name"].ToString();
                    cmb_brand.SelectedValue        = dttable.Rows[0]["vehicle_brand"].ToString();
                    txt_country.Text               = dttable.Rows[0]["country_name"].ToString();
                    cmb_group.SelectedValue        = dttable.Rows[0]["vehicle_group"].ToString();
                    num_engine.Value               = int.Parse(dttable.Rows[0]["engine_capacity"].ToString());
                    num_no_of_door.Value           = int.Parse(dttable.Rows[0]["no_of_door"].ToString());
                    num_seat_capacity.Value        = int.Parse(dttable.Rows[0]["seat_capacity"].ToString());
                    cmb_fuel_type.SelectedValue    = int.Parse(dttable.Rows[0]["fuel_type"].ToString());
                    cmb_transmission.SelectedValue = int.Parse(dttable.Rows[0]["transmission"].ToString());
                    txt_remarks.Text               = dttable.Rows[0]["Remarks"].ToString();
                }
            }

            this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.Initilise_grd_img);
        }
예제 #2
0
        /// <summary>
        /// this form is used to edit vehicle brand or vehicle group
        /// </summary>
        /// <param name="brand_id"></param>
        /// <param name="int_country"></param>
        public Form_edit_vehicle_brand(int brand_id = 0, int int_country = 0)
        {
            InitializeComponent();

            Classes.Class_style.Grd_style.Common_style(grd_main);

            _int_brand_id = brand_id;

            cmb1.DisplayMember = "display";
            cmb1.ValueMember   = "value";
            cmb1.DataSource    = Combobox_options_ds.Select_country();

            if (int_country != 0)
            {
                cmb1.SelectedValue = int_country;
            }
        }