Example #1
0
 public static void DDLState(Controller _controller, string key = "Title", string value = "Title", object selected = null, string countryName = null)
 {
     using (var objBLL = new MasterBLL())
     {
         _controller.ViewBag.States = new SelectList(objBLL.GetStates(countryName), key, value, selected);
     }
 }
Example #2
0
        public JsonResult GetState(string countryname)
        {
            ResultVM result = new ResultVM();

            try
            {
                using (MasterBLL oMasterBLL = new MasterBLL())
                {
                    result.Data      = oMasterBLL.GetStates(countryname);
                    result.IsSuccess = true;
                }
            }
            catch (Exception ex)
            {
                result.Errors    = ex;
                result.Message   = ex.Message;
                result.IsSuccess = false;
                Helper.LogException(ex, "MasterController_GetState");
            }
            return(Json(result, JsonRequestBehavior.AllowGet));
        }