コード例 #1
0
        protected void SaveHomeCities_Click(object sender, EventArgs e)
        {
            Int64 SupplierId = SuppliersSessionHelper.SupplierId();

            SupplierController.DeleteAllSupplierHomeCity(SupplierId);
            foreach (RepeaterItem rItem in rptHomeCity.Items)
            {
                foreach (ListItem item in ((CheckBoxList)rItem.FindControl("cblCities")).Items)
                {
                    if (item.Selected == true)
                    {
                        SupplierHomeServiceCity sc = new SupplierHomeServiceCity();
                        sc.CityId     = Convert.ToInt64(item.Value);
                        sc.SupplierId = SupplierId;
                        sc.ServiceId  = Service.FetchHomeService();
                        sc.Save();
                    }
                }
            }
        }