示例#1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     totalPrice = Convert.ToInt32(Label23.Text);
     if (Page.Request.QueryString["username"] != null)
     {
         Label2.Text = Page.Request.QueryString["username"];
     }
     if (!IsPostBack)
     {
         using (SqlConnection connection = new SqlConnection(connectionString))
         {
             SqlCommand command = new SqlCommand("EXEC ListAllCities", connection);
             connection.Open();
             SqlDataReader reader = command.ExecuteReader();
             cityList.DataSource     = reader;
             cityList.DataTextField  = "Name";
             cityList.DataValueField = "ID";
             cityList.DataBind();
         }
         using (SqlConnection connection = new SqlConnection(connectionString))
         {
             DistrictList.Items.Clear();
             SqlCommand command = new SqlCommand("EXEC ListAllDistrictsWithCity " + cityList.SelectedItem.Value, connection);
             connection.Open();
             SqlDataReader reader = command.ExecuteReader();
             DistrictList.DataSource     = reader;
             DistrictList.DataTextField  = "Name";
             DistrictList.DataValueField = "ID";
             DistrictList.DataBind();
         }
     }
 }
示例#2
0
        protected void cityList_SelectedIndexChanged(object sender, EventArgs e)
        {
            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                DistrictList.Items.Clear();
                SqlCommand command = new SqlCommand("EXEC ListAllDistrictsWithCity " + cityList.SelectedItem.Value, connection);
                connection.Open();
                SqlDataReader reader = command.ExecuteReader();
                DistrictList.DataSource     = reader;
                DistrictList.DataTextField  = "Name";
                DistrictList.DataValueField = "ID";
                DistrictList.DataBind();
            }

            CompanyList.Items.Clear();
            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                SqlCommand command = new SqlCommand("EXEC ShowCompanyOnDistrict " + DistrictList.SelectedItem.Value, connection);
                connection.Open();
                SqlDataReader reader = command.ExecuteReader();
                CompanyList.DataSource     = reader;
                CompanyList.DataTextField  = "CompanyName";
                CompanyList.DataValueField = "ID";
                CompanyList.DataBind();
            }
        }
示例#3
0
        /// <summary>
        /// To fetch details from database
        /// </summary>
        /// <returns></returns>
        public DistrictList GetDistrict()
        {
            cnn = new OracleConnection(connStr);

            string proc = "USP_MST_GET_DISTRICT";

            cmd             = new OracleCommand(proc, cnn);
            cmd.CommandType = CommandType.StoredProcedure;


            cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output;
            cmd.Connection.Open();
            OracleDataReader dr         = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            DistrictBO       objDisBO   = null;
            DistrictList     objDislist = new DistrictList();

            while (dr.Read())
            {
                objDisBO = new DistrictBO();
                if (!dr.IsDBNull(dr.GetOrdinal("DISTRICTID")))
                {
                    objDisBO.DistrictID = dr.GetInt32(dr.GetOrdinal("DISTRICTID"));
                }
                //  objDisBO.DistrictID = (Convert.ToInt32(dr.GetValue(dr.GetOrdinal("DISTRICTID"))));
                if (!dr.IsDBNull(dr.GetOrdinal("DISTRICTNAME")))
                {
                    objDisBO.DistrictName = dr.GetValue(dr.GetOrdinal("DISTRICTNAME")).ToString();
                }
                objDislist.Add(objDisBO);
            }

            dr.Close();
            return(objDislist);
        }
示例#4
0
        /// <summary>
        /// To get details
        /// </summary>
        /// <param name="districtname"></param>
        /// <returns></returns>
        public DistrictList SearchDistrict(string districtname)
        {
            proc = "USP_MST_SEARCH_ALLDISTRICTS";
            DistrictBO   objDisBO   = null;
            DistrictList objDislist = new DistrictList();

            using (cnn = new OracleConnection(connStr))
            {
                using (cmd = new OracleCommand(proc, cnn))
                {
                    cmd.CommandType = CommandType.StoredProcedure;

                    if (districtname != "")
                    {
                        cmd.Parameters.Add("DistrictName_", districtname);
                    }
                    else
                    {
                        cmd.Parameters.Add("DistrictName_", DBNull.Value);
                    }


                    cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output;

                    try
                    {
                        cmd.Connection.Open();
                        OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);

                        while (dr.Read())
                        {
                            objDisBO = new DistrictBO();

                            if (!dr.IsDBNull(dr.GetOrdinal("DISTRICTID")))
                            {
                                objDisBO.DistrictID = dr.GetInt32(dr.GetOrdinal("DISTRICTID"));
                            }
                            if (!dr.IsDBNull(dr.GetOrdinal("DISTRICTNAME")))
                            {
                                objDisBO.DistrictName = dr.GetString(dr.GetOrdinal("DISTRICTNAME"));
                            }
                            if (!dr.IsDBNull(dr.GetOrdinal("ISDELETED")))
                            {
                                objDisBO.IsDeleted = dr.GetString(dr.GetOrdinal("ISDELETED"));
                            }

                            objDislist.Add(objDisBO);
                        }

                        dr.Close();
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
                }
            }

            return(objDislist);
        }
        public void UpdateDistricts(Customer customer)
        {
            var toRemove = new List <DistrictToСlient>();

            foreach (var district in customer.DistrictToClients)
            {
                if (!DistrictList.Contains(district.DistrictId))
                {
                    toRemove.Add(district);
                }
            }

            toRemove.ForEach(x => customer.DistrictToClients.Remove(x));

            foreach (var districtId in DistrictList)
            {
                var district = customer.DistrictToClients.FirstOrDefault(x => x.DistrictId == districtId);
                if (district == null)
                {
                    customer.DistrictToClients.Add(new DistrictToСlient()
                    {
                        ClientId   = customer.Id,
                        DistrictId = districtId
                    });
                }
            }
        }
示例#6
0
        private async void GetDistrict()
        {
            var response = await service.GetDistrict();

            switch (response.Item1)
            {
            case 1:
                List <District> dList = response.Item2;
                foreach (var dis in dList)
                {
                    DistrictList.Add(dis);
                }
                break;

            case 2:
                await App.Current.MainPage.DisplayAlert("錯誤", "系統錯誤。", "確定");

                break;

            case 3:
                await App.Current.MainPage.DisplayAlert("錯誤", "伺服器無回應,網路連線錯誤。", "確定");

                break;

            default:
                break;
            }
        }
示例#7
0
 protected void ResetButton_Click(object sender, EventArgs e)
 {
     AllListPanel.Visible  = true;
     SearchedPanel.Visible = false;
     DistrictList.ClearSelection();
     BRDropDown.ClearSelection();
     StatusList.ClearSelection();
 }
示例#8
0
        public async Task GetDistrictAsync()
        {
            this.DistrictList.Clear();
            if (EmployeeModel.ProvinceId.HasValue)
            {
                ApiResponse apiResponse = await ApiHelper.Get <List <District> >($"api/districts/{EmployeeModel.ProvinceId}", false, false);

                List <District> data = (List <District>)apiResponse.Content;
                foreach (var item in data)
                {
                    DistrictList.Add(item);
                }
            }
        }
示例#9
0
        protected void DistrictList_bind()//绑定到行政区DropList
        {
            //行政区拼接查询语句
            string  sql = "SELECT text,left+'" + config.Rows[0]["districtName"] + "'+' '+value,value1 FROM [District$] WHERE " + config.Rows[0]["tableName"] + " = 1";
            DataSet ds  = QuaryExcel(sql);

            //清除all选项的多余字段
            ds.Tables[0].Rows[0]["Expr1001"] = "";
            //绑定到下拉菜单
            DistrictList.DataSource     = ds;
            DistrictList.DataTextField  = "text";
            DistrictList.DataValueField = "Expr1001";
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)  //拼接value和value1
            {
                ds.Tables[0].Rows[i][1] = ds.Tables[0].Rows[i][1].ToString() + ds.Tables[0].Rows[i][2].ToString();
            }
            DistrictList.DataBind();
        }
示例#10
0
 protected void AddDistrictButton_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrWhiteSpace(DistrictTextBox.Text) && CityList.SelectedIndex != -1)
     {
         using (SqlConnection connection = new SqlConnection(connectionString))
         {
             SqlCommand command = new SqlCommand("EXEC InsertDistrict " + DistrictTextBox.Text + "," + CityList.SelectedItem.Value, connection);
             connection.Open();
             command.ExecuteReader();
             DistrictList.Items.Clear();
             SqlCommand    command2 = new SqlCommand("EXEC ListAllDistrictsWithCity " + CityList.SelectedItem.Value, connection);
             SqlDataReader reader   = command2.ExecuteReader();
             DistrictList.DataSource     = reader;
             DistrictList.DataTextField  = "Name";
             DistrictList.DataValueField = "ID";
             DistrictList.DataBind();
         }
     }
 }
示例#11
0
 protected void DeleteDistrictButton_Click(object sender, EventArgs e)
 {
     if (DistrictList.SelectedItem != null)
     {
         using (SqlConnection connection = new SqlConnection(connectionString))
         {
             SqlCommand command = new SqlCommand("EXEC DeleteDistrict " + DistrictList.SelectedItem.Value, connection);
             connection.Open();
             command.ExecuteReader();
             DistrictList.Items.Clear();
             SqlCommand    command2 = new SqlCommand("EXEC ListAllDistrictsWithCity " + CityList.SelectedItem.Value, connection);
             SqlDataReader reader   = command2.ExecuteReader();
             DistrictList.DataSource     = reader;
             DistrictList.DataTextField  = "Name";
             DistrictList.DataValueField = "ID";
             DistrictList.DataBind();
         }
     }
 }
示例#12
0
        public DistrictList LoadDistrictData()
        {
            cnn = new OracleConnection(AppConfiguration.ConnectionString);
            string proc = "USP_MST_GET_DISTRICT";

            cmd             = new OracleCommand(proc, cnn);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("Sp_recordset", OracleDbType.RefCursor).Direction = ParameterDirection.Output;
            cmd.Connection.Open();
            OracleDataReader dr       = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            DistrictBO       obMaster = null;
            DistrictList     Master   = new DistrictList();

            while (dr.Read())
            {
                obMaster              = new DistrictBO();
                obMaster.DistrictID   = dr.GetInt32(dr.GetOrdinal("DISTRICTID"));
                obMaster.DistrictName = dr.GetString(dr.GetOrdinal("DISTRICTNAME"));
                Master.Add(obMaster);
            }
            dr.Close();
            return(Master);
        }
示例#13
0
        public AllHouseListViewModel(string search)
        {
            SearchContent = search;

            SortTypeList  = new[] { "出售", "出租" };
            DistrictList  = new[] { "全部区域", "青白江区", "郫都区", "金牛区", "成华区", "高新西区", "武侯区", "锦江区", "高新区", "天府新区", "温江区", "新都区", "青羊区", "双流区", "龙泉驿区" };
            RoomStyleList = new[] { "全部房型", "1房", "2房", "3房", "4房及以上" };
            SalePriceList = new[] { "全部价格", "0-30万", "30-50万", "50-100万", "100-150万", "150-200万", "200-300万", "300-500万", "500万以上" };
            SquareList    = new[] { "全部面积", "0-20平", "20-50平", "50-100平", "100-150平", "150-200平", "200-250平", "250-500平", "500-800平", "800平以上" };

            //UsageList = new List<string> { "全部用途", "住宅", "商住", "商铺", "网店", "写字楼", "厂房", "写厂", "铺厂", "仓库", "地皮", "车位", "其他" };
            //PanTypeList = new List<string> { "全部类型", "公盘", "私盘", "特盘", "封盘" };

            SortType  = SortTypeList[0];
            District  = DistrictList[0];
            RoomStyle = RoomStyleList[0];
            SalePrice = SalePriceList[0];
            Square    = SquareList[0];

            HouseItemList     = new ObservableCollection <HouseItemInfo>();
            saleHouseItemList = new List <HouseItemInfo>();
            rentHouseItemList = new List <HouseItemInfo>();
            saleHouseList     = new List <HouseInfo>();
            rentHouseList     = new List <HouseInfo>();

            SaleHousePara = new HousePara
            {
                DistrictName  = "区域",
                CountF        = "房型",
                Price         = "价格",
                Square        = "面积",
                PropertyUsage = "用途",
                EstateName    = "",
                BuildNo       = "",
                RoomNo        = "",
                PanType       = "有效",
                Floor         = "",
                MinPrice      = "",
                MaxPrice      = "",
                EmpID         = ""
            };

            SortList = new ObservableCollection <string>();

            //radios = new bool[5] { false, false, false, false, false };
            radios     = new BitArray(5);
            tempRadios = new BitArray(5);

            SortCommand = new Command <string>((t) =>
            {
                Visible = !Visible;
                if (!Visible)
                {
                    return;
                }

                SortList.Clear();
                switch (t)
                {
                //分类
                case "0":
                    {
                        tempRadios[0] = true;
                        radios        = radios.Or(tempRadios).And(tempRadios); //先或再与,保证只有一个true
                        tempRadios[0] = false;
                        //for (int i = 0; i < 5; i++)
                        //{
                        //    radios[i] = false;
                        //}
                        //radios[0] = true;

                        //SortList.Clear();
                        SortTypeList.ForEach(item => { SortList.Add(item); });
                    }
                    break;

                //区域
                case "1":
                    {
                        tempRadios[1] = true;
                        radios        = radios.Or(tempRadios).And(tempRadios);
                        tempRadios[1] = false;
                        //for (int i = 0; i < 5; i++)
                        //{
                        //    radios[i] = false;
                        //}
                        //radios[1] = true;

                        //SortList.Clear();
                        DistrictList.ForEach(item => { SortList.Add(item); });
                    }
                    break;

                //房型
                case "2":
                    {
                        tempRadios[2] = true;
                        radios        = radios.Or(tempRadios).And(tempRadios);
                        tempRadios[2] = false;
                        //for (int i = 0; i < 5; i++)
                        //{
                        //    radios[i] = false;
                        //}
                        //radios[2] = true;

                        //SortList.Clear();
                        RoomStyleList.ForEach(item => { SortList.Add(item); });
                    }
                    break;

                //价格
                case "3":
                    {
                        tempRadios[3] = true;
                        radios        = radios.Or(tempRadios).And(tempRadios);
                        tempRadios[3] = false;
                        //for (int i = 0; i < 5; i++)
                        //{
                        //    radios[i] = false;
                        //}
                        //radios[3] = true;

                        //SortList.Clear();
                        SalePriceList.ForEach(item => { SortList.Add(item); });
                    }
                    break;

                //面积
                case "4":
                    {
                        tempRadios[4] = true;
                        radios        = radios.Or(tempRadios).And(tempRadios);
                        tempRadios[4] = false;
                        //for (int i = 0; i < 5; i++)
                        //{
                        //    radios[i] = false;
                        //}
                        //radios[4] = true;

                        //SortList.Clear();
                        SquareList.ForEach(item => { SortList.Add(item); });
                    }
                    break;

                default:
                    break;
                }
            }, (t) => { return(true); });

            OnSortChangedCommand = new Command <string>((t) =>
            {
                int index = 0;
                foreach (var item in radios)
                {
                    if ((bool)item)
                    {
                        break;
                    }
                    index++;
                }

                switch (index)
                {
                //分类
                case 0:
                    {
                        SortType = t;
                        if (SortType == "出售")
                        {
                            if (saleHouseItemList.Count == 0)
                            {
                                GetHouseList();
                            }
                            else
                            {
                                HouseItemList.Clear();
                                saleHouseItemList.ForEach(item => { HouseItemList.Add(item); });
                            }
                        }
                        else if (SortType == "出租")
                        {
                            if (rentHouseItemList.Count == 0)
                            {
                                GetHouseList();
                            }
                            else
                            {
                                HouseItemList.Clear();
                                rentHouseItemList.ForEach(item => { HouseItemList.Add(item); });
                            }
                        }
                    }
                    break;

                //区域
                case 1:
                    {
                        District = t;
                        SaleHousePara.DistrictName = District == "全部区域" ? "区域" : District.TrimEnd('区');
                        GetHouseList();
                    }
                    break;

                //房型
                case 2:
                    {
                        RoomStyle            = t;
                        SaleHousePara.CountF = RoomStyle == "全部房型" ? "房型" : RoomStyle;
                        GetHouseList();
                    }
                    break;

                //价格
                case 3:
                    {
                        SalePrice           = t;
                        SaleHousePara.Price = SalePrice == "全部价格" ? "价格" : SalePrice;
                        GetHouseList();
                    }
                    break;

                //面积
                case 4:
                    {
                        Square = t;
                        SaleHousePara.Square = Square == "全部面积" ? "面积" : Square;
                        GetHouseList();
                    }
                    break;

                default:
                    break;
                }
                Visible = false;
            }, (t) => { return(true); });

            /*SortCommand = new Command<string>(async (t) =>
             * {
             *  switch (t)
             *  {
             *      //分类
             *      case "0":
             *          {
             *              string result = await Application.Current.MainPage.DisplayActionSheet("分类", "取消", null, SortTypeList);
             *              SortType = result == null || result == "取消" ? SortType: result;
             *
             *              if (SortType == "出售")
             *              {
             *                  if (saleHouseItemList.Count == 0)
             *                  {
             *                      GetHouseList();
             *                  }
             *                  else
             *                  {
             *                      HouseItemList.Clear();
             *                      saleHouseItemList.ForEach(item => { HouseItemList.Add(item); });
             *                  }
             *              }
             *              else if (SortType == "出租")
             *              {
             *                  if (rentHouseItemList.Count == 0)
             *                  {
             *                      GetHouseList();
             *                  }
             *                  else
             *                  {
             *                      HouseItemList.Clear();
             *                      rentHouseItemList.ForEach(item => { HouseItemList.Add(item); });
             *                  }
             *              }
             *          }
             *          break;
             *
             *      //区域
             *      case "1":
             *          {
             *              string result = await Application.Current.MainPage.DisplayActionSheet("区域", "取消", null, DistrictList);
             *              District = result == null || result == "取消" ? District : result;
             *              SaleHousePara.DistrictName = District == "全部区域" ? "区域" : District.TrimEnd('区');
             *              GetHouseList();
             *          }
             *          break;
             *
             *      //房型
             *      case "2":
             *          {
             *              string result = await Application.Current.MainPage.DisplayActionSheet("区域", "取消", null, RoomStyleList);
             *              RoomStyle = result == null || result == "取消" ? RoomStyle : result;
             *              SaleHousePara.CountF = RoomStyle == "全部房型" ? "房型" : RoomStyle;
             *              GetHouseList();
             *          }
             *          break;
             *
             *      //价格
             *      case "3":
             *          {
             *              string result = await Application.Current.MainPage.DisplayActionSheet("价格", "取消", null, SalePriceList);
             *              SalePrice = result == null || result == "取消" ? SalePrice : result;
             *              SaleHousePara.Price = SalePrice == "全部价格" ? "价格" : SalePrice;
             *              GetHouseList();
             *          }
             *          break;
             *
             *      //面积
             *      case "4":
             *          {
             *              string result = await Application.Current.MainPage.DisplayActionSheet("面积", "取消", null, SquareList);
             *              Square = result == null || result == "取消" ? Square : result;
             *              SaleHousePara.Square = Square == "全部面积" ? "面积" : Square;
             *              GetHouseList();
             *          }
             *          break;
             *
             *      default:
             *          break;
             *  }
             * }, (t) => { return true; });*/

            VisibleCommand = new Command(() =>
            {
                Visible = !Visible;
            }, () => { return(true); });

            SearchCommand = new Command(() =>
            {
                GetHouseList();
            }, () => { return(true); });

            TappedCommand = new Command <string>((h) =>
            {
                if (SortType == "出售")
                {
                    saleHouseList.ForEach((item) =>
                    {
                        if (item.PropertyID == h)
                        {
                            HouseDetailPage houseDetailPage = new HouseDetailPage(item);
                            Application.Current.MainPage.Navigation.PushAsync(houseDetailPage);
                        }
                    });
                }
                else
                {
                    rentHouseList.ForEach((item) =>
                    {
                        if (item.PropertyID == h)
                        {
                            HouseDetailPage houseDetailPage = new HouseDetailPage(item);
                            Application.Current.MainPage.Navigation.PushAsync(houseDetailPage);
                        }
                    });
                }
            }, (h) => { return(true); });

            GetHouseList();
        }
 protected void ResetButton_Click(object sender, EventArgs e)
 {
     Panel1.Visible = true;
     Panel2.Visible = false;
     DistrictList.ClearSelection();
 }
示例#15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ModelEvent" /> class.
 /// </summary>
 /// <param name="Key">TBA event key with the format yyyy[EVENT_CODE], where yyyy is the year, and EVENT_CODE is the event code of the event. (required).</param>
 /// <param name="Name">Official name of event on record either provided by FIRST or organizers of offseason event. (required).</param>
 /// <param name="EventCode">Event short code, as provided by FIRST. (required).</param>
 /// <param name="EventType">Event Type, as defined here: https://github.com/the-blue-alliance/the-blue-alliance/blob/master/consts/event_type.py#L2 (required).</param>
 /// <param name="District">The district this event is in, may be null..</param>
 /// <param name="City">City, town, village, etc. the event is located in..</param>
 /// <param name="StateProv">State or Province the event is located in..</param>
 /// <param name="Country">Country the event is located in..</param>
 /// <param name="StartDate">Event start date in &#x60;yyyy-mm-dd&#x60; format. (required).</param>
 /// <param name="EndDate">Event end date in &#x60;yyyy-mm-dd&#x60; format. (required).</param>
 /// <param name="Year">Year the event data is for. (required).</param>
 /// <param name="ShortName">Same as &#x60;name&#x60; but doesn&#39;t include event specifiers, such as &#39;Regional&#39; or &#39;District&#39;. May be null..</param>
 /// <param name="EventTypeString">Event Type, eg Regional, District, or Offseason. (required).</param>
 /// <param name="Week">Week of the event relative to the first official season event, zero-indexed. Only valid for Regionals, Districts, and District Championships. Null otherwise. (Eg. A season with a week 0 &#39;preseason&#39; event does not count, and week 1 events will show 0 here. Seasons with a week 0.5 regional event will show week 0 for those event(s) and week 1 for week 1 events and so on.).</param>
 /// <param name="Address">Address of the event&#39;s venue, if available..</param>
 /// <param name="PostalCode">Postal code from the event address..</param>
 /// <param name="GmapsPlaceId">Google Maps Place ID for the event address..</param>
 /// <param name="GmapsUrl">Link to address location on Google Maps..</param>
 /// <param name="Lat">Latitude for the event address..</param>
 /// <param name="Lng">Longitude for the event address..</param>
 /// <param name="LocationName">Name of the location at the address for the event, eg. Blue Alliance High School..</param>
 /// <param name="Timezone">Timezone name..</param>
 /// <param name="Website">The event&#39;s website, if any..</param>
 /// <param name="FirstEventId">The FIRST internal Event ID, used to link to the event on the FRC webpage..</param>
 /// <param name="FirstEventCode">Public facing event code used by FIRST (on frc-events.firstinspires.org, for example).</param>
 /// <param name="Webcasts">Webcasts.</param>
 /// <param name="DivisionKeys">An array of event keys for the divisions at this event..</param>
 /// <param name="ParentEventKey">The TBA Event key that represents the event&#39;s parent. Used to link back to the event from a division event. It is also the inverse relation of &#x60;divison_keys&#x60;..</param>
 /// <param name="PlayoffType">Playoff Type, as defined here: https://github.com/the-blue-alliance/the-blue-alliance/blob/master/consts/playoff_type.py#L4, or null..</param>
 /// <param name="PlayoffTypeString">String representation of the &#x60;playoff_type&#x60;, or null..</param>
 public ModelEvent(string Key = default(string), string Name = default(string), string EventCode = default(string), int?EventType = default(int?), DistrictList District = default(DistrictList), string City = default(string), string StateProv = default(string), string Country = default(string), DateTime?StartDate = default(DateTime?), DateTime?EndDate = default(DateTime?), int?Year = default(int?), string ShortName = default(string), string EventTypeString = default(string), int?Week = default(int?), string Address = default(string), string PostalCode = default(string), string GmapsPlaceId = default(string), string GmapsUrl = default(string), double?Lat = default(double?), double?Lng = default(double?), string LocationName = default(string), string Timezone = default(string), string Website = default(string), string FirstEventId = default(string), string FirstEventCode = default(string), List <Webcast> Webcasts = default(List <Webcast>), List <string> DivisionKeys = default(List <string>), string ParentEventKey = default(string), int?PlayoffType = default(int?), string PlayoffTypeString = default(string))
 {
     // to ensure "Key" is required (not null)
     if (Key == null)
     {
         throw new InvalidDataException("Key is a required property for ModelEvent and cannot be null");
     }
     else
     {
         this.Key = Key;
     }
     // to ensure "Name" is required (not null)
     if (Name == null)
     {
         throw new InvalidDataException("Name is a required property for ModelEvent and cannot be null");
     }
     else
     {
         this.Name = Name;
     }
     // to ensure "EventCode" is required (not null)
     if (EventCode == null)
     {
         throw new InvalidDataException("EventCode is a required property for ModelEvent and cannot be null");
     }
     else
     {
         this.EventCode = EventCode;
     }
     // to ensure "EventType" is required (not null)
     if (EventType == null)
     {
         throw new InvalidDataException("EventType is a required property for ModelEvent and cannot be null");
     }
     else
     {
         this.EventType = EventType;
     }
     // to ensure "StartDate" is required (not null)
     if (StartDate == null)
     {
         throw new InvalidDataException("StartDate is a required property for ModelEvent and cannot be null");
     }
     else
     {
         this.StartDate = StartDate;
     }
     // to ensure "EndDate" is required (not null)
     if (EndDate == null)
     {
         throw new InvalidDataException("EndDate is a required property for ModelEvent and cannot be null");
     }
     else
     {
         this.EndDate = EndDate;
     }
     // to ensure "Year" is required (not null)
     if (Year == null)
     {
         throw new InvalidDataException("Year is a required property for ModelEvent and cannot be null");
     }
     else
     {
         this.Year = Year;
     }
     // to ensure "EventTypeString" is required (not null)
     if (EventTypeString == null)
     {
         throw new InvalidDataException("EventTypeString is a required property for ModelEvent and cannot be null");
     }
     else
     {
         this.EventTypeString = EventTypeString;
     }
     this.District          = District;
     this.City              = City;
     this.StateProv         = StateProv;
     this.Country           = Country;
     this.ShortName         = ShortName;
     this.Week              = Week;
     this.Address           = Address;
     this.PostalCode        = PostalCode;
     this.GmapsPlaceId      = GmapsPlaceId;
     this.GmapsUrl          = GmapsUrl;
     this.Lat               = Lat;
     this.Lng               = Lng;
     this.LocationName      = LocationName;
     this.Timezone          = Timezone;
     this.Website           = Website;
     this.FirstEventId      = FirstEventId;
     this.FirstEventCode    = FirstEventCode;
     this.Webcasts          = Webcasts;
     this.DivisionKeys      = DivisionKeys;
     this.ParentEventKey    = ParentEventKey;
     this.PlayoffType       = PlayoffType;
     this.PlayoffTypeString = PlayoffTypeString;
 }
 protected override void InitializeEntities()
 {
     DistrictList     = _DistrictService.GetAll().ToList();
     SelectedDistrict = DistrictList.Any() ? DistrictList.First() : null;
     UpdateCollection();
 }
示例#17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EventSimple" /> class.
 /// </summary>
 /// <param name="Key">TBA event key with the format yyyy[EVENT_CODE], where yyyy is the year, and EVENT_CODE is the event code of the event. (required).</param>
 /// <param name="Name">Official name of event on record either provided by FIRST or organizers of offseason event. (required).</param>
 /// <param name="EventCode">Event short code, as provided by FIRST. (required).</param>
 /// <param name="EventType">Event Type, as defined here: https://github.com/the-blue-alliance/the-blue-alliance/blob/master/consts/event_type.py#L2 (required).</param>
 /// <param name="District">The district this event is in, may be null..</param>
 /// <param name="City">City, town, village, etc. the event is located in..</param>
 /// <param name="StateProv">State or Province the event is located in..</param>
 /// <param name="Country">Country the event is located in..</param>
 /// <param name="StartDate">Event start date in &#x60;yyyy-mm-dd&#x60; format. (required).</param>
 /// <param name="EndDate">Event end date in &#x60;yyyy-mm-dd&#x60; format. (required).</param>
 /// <param name="Year">Year the event data is for. (required).</param>
 public EventSimple(string Key = default(string), string Name = default(string), string EventCode = default(string), int?EventType = default(int?), DistrictList District = default(DistrictList), string City = default(string), string StateProv = default(string), string Country = default(string), DateTime?StartDate = default(DateTime?), DateTime?EndDate = default(DateTime?), int?Year = default(int?))
 {
     // to ensure "Key" is required (not null)
     if (Key == null)
     {
         throw new InvalidDataException("Key is a required property for EventSimple and cannot be null");
     }
     else
     {
         this.Key = Key;
     }
     // to ensure "Name" is required (not null)
     if (Name == null)
     {
         throw new InvalidDataException("Name is a required property for EventSimple and cannot be null");
     }
     else
     {
         this.Name = Name;
     }
     // to ensure "EventCode" is required (not null)
     if (EventCode == null)
     {
         throw new InvalidDataException("EventCode is a required property for EventSimple and cannot be null");
     }
     else
     {
         this.EventCode = EventCode;
     }
     // to ensure "EventType" is required (not null)
     if (EventType == null)
     {
         throw new InvalidDataException("EventType is a required property for EventSimple and cannot be null");
     }
     else
     {
         this.EventType = EventType;
     }
     // to ensure "StartDate" is required (not null)
     if (StartDate == null)
     {
         throw new InvalidDataException("StartDate is a required property for EventSimple and cannot be null");
     }
     else
     {
         this.StartDate = StartDate;
     }
     // to ensure "EndDate" is required (not null)
     if (EndDate == null)
     {
         throw new InvalidDataException("EndDate is a required property for EventSimple and cannot be null");
     }
     else
     {
         this.EndDate = EndDate;
     }
     // to ensure "Year" is required (not null)
     if (Year == null)
     {
         throw new InvalidDataException("Year is a required property for EventSimple and cannot be null");
     }
     else
     {
         this.Year = Year;
     }
     this.District  = District;
     this.City      = City;
     this.StateProv = StateProv;
     this.Country   = Country;
 }