예제 #1
0
    /// <summary>
    /// Bind the divisions by region
    /// </summary>
    private void BindDivisions()
    {
        //获取当前region的所有division
        var dsDivisions = _bllDivisions.GetList(string.Format(" [RegionID]={0}", CurrentRegion.RegionId));

        gridDivisionList.DataSource = dsDivisions;
        gridDivisionList.DataBind();
    }
예제 #2
0
        /// <summary>
        /// Get division data
        /// </summary>
        /// <returns></returns>
        private DataTable GetDivisionData(string sRegionID)
        {
            DataTable dtDivision;

            try
            {
                Divisions divisionManager = new Divisions();
                //Binding Division
                string sCondition = " Enabled='true'";
                if (sRegionID != "" && sRegionID != "0")
                {
                    sCondition += " AND RegionID = " + sRegionID;
                }
                dtDivision = divisionManager.GetList(sCondition).Tables[0];

                DataRow drNewDivision = dtDivision.NewRow();
                drNewDivision["DivisionId"] = 0;
                drNewDivision["Name"]       = "All Divisions";
                dtDivision.Rows.InsertAt(drNewDivision, 0);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(dtDivision);
        }