コード例 #1
0
        public JsonResult GetCityByState(Int64 StateId)
        {
            CommonBL          objCommonBL = null;
            List <CityMaster> lstCity     = null;

            try
            {
                objCommonBL = new CommonBL();
                lstCity     = objCommonBL.GetTable <CityMaster>(new TableFilter()
                {
                    Condition = " and Status = 1 and StateId = " + StateId, IdColumn = "CityID", TextColumn = "CityName", TableName = "CityMaster"
                });
                return(Json(new SelectList(lstCity, "CityID", "CityName"), JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #2
0
        public JsonResult GetStateOnCountryId(Int64 CountryId)
        {
            CommonBL objCommonBL = null;

            try
            {
                objDetailsVM          = new AreaDetailsVM();
                objCommonBL           = new CommonBL();
                objDetailsVM.StateMst = objCommonBL.GetTable <StateMaster>(new TableFilter()
                {
                    Condition = " and Status = 1 and CountryId = " + CountryId, IdColumn = "StateId", TextColumn = "StateName", TableName = "StateMaster"
                });
                return(Json(new SelectList(objDetailsVM.StateMst, "StateID", "StateName"), JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }