public void DeleteStationGroup(int stationGroupId, string userId)
        {
            TBL_STATION_GROUP sg = stationGroupRepository.GetById(stationGroupId);

            sg.UPDATE_USER = userId;
            sg.IS_DELETED  = true;
            stationGroupRepository.Update(sg);
        }
 public JsonResult SaveStationGroup(StationGroupViewModel stg)
 {
     try
     {
         TBL_STATION_GROUP entity = Mapper.Map <StationGroupViewModel, TBL_STATION_GROUP>(stg);
         entity.UPDATE_USER  = User.Identity.GetUserId();
         entity.CREATED_DATE = DateTime.Now;
         stationGroupService.CreateStationGroup(entity);
         stationGroupService.SaveStationGroup();
         return(Json(""));
     }
     catch (Exception ex)
     {
         return(Json(ex.Message));
     }
 }
        //public Category GetCategory(int id)
        //{
        //    var category = categorysRepository.GetById(id);
        //    return category;
        //}

        //public Category GetCategory(string name)
        //{
        //    var category = categorysRepository.GetCategoryByName(name);
        //    return category;
        //}

        public void CreateStationGroup(TBL_STATION_GROUP stationGroup)
        {
            stationGroupRepository.Add(stationGroup);
        }
 public void UpdateStationGroup(TBL_STATION_GROUP stationGroup)
 {
     stationGroupRepository.Update(stationGroup);
 }
 public bool IsStationGroupExist(TBL_STATION_GROUP stationGroup)
 {
     return(stationGroupRepository.Get(x => x.IS_DELETED == false && x.ID != stationGroup.ID && stationGroup.COMPANY_ID == x.COMPANY_ID && x.NAME.ToUpper() == stationGroup.NAME.ToUpper()) == null ? false : true);
 }