public JsonResult DeleteEmbroideryFirmLocattion(Guid id)
 {
     try
     {
         if (!new EmbroideryFirmLocationsBL().IsPrimaryLocation(id))
         {
             bool Result = new EmbroideryFirmLocationsBL().Delete(id);
             if (Result == true)
             {
                 return(Json(new { success = true, message = CommonMsg.Success(EntityNames.EmbroideryFirmLocation, En_CRUD.Delete) }));
             }
             else
             {
                 return(Json(new { success = false, message = CommonMsg.DependancyError() }));
             }
         }
         else
         {
             return(Json(new { success = false, message = "you can't delete Primary Location, Please set other Location as Primary Location first." }));
         }
     }
     catch (Exception ex)
     {
         return(Json(new { success = false, message = CommonMsg.Fail(EntityNames.EmbroideryFirmLocation, En_CRUD.Delete) }));
     }
 }
Exemple #2
0
 public JsonResult DeleteStudent(int id)
 {
     try
     {
         new StudentBL().Delete(id);
         return(Json(new { success = true, Message = CommonMsg.Success_Delete(EntityNames.Student) }));
     }
     catch (Exception ex)
     {
         return(Json(new { success = false, Message = CommonMsg.DependancyError() }));
     }
 }
Exemple #3
0
 public JsonResult Delete(int id = 0)
 {
     try
     {
         bool Result = new JariCompanyBL().Delete(id);
         if (Result == true)
         {
             return(Json(new { success = true, message = CommonMsg.Success(EntityNames.Company, En_CRUD.Delete) }));
         }
         else
         {
             return(Json(new { success = false, message = CommonMsg.DependancyError() }));
         }
     }
     catch (Exception ex)
     {
         return(Json(new { success = false, message = CommonMsg.Fail(EntityNames.Company, En_CRUD.Delete) }));
     }
 }
 public JsonResult Delete(Guid?id)
 {
     try
     {
         bool Result = new UserBL().Delete((Guid)id);
         if (Result == true)
         {
             return(Json(new { success = true, message = CommonMsg.Success(EntityNames.User, En_CRUD.Delete) }));
         }
         else
         {
             return(Json(new { success = false, message = CommonMsg.DependancyError() }));
         }
     }
     catch (Exception ex)
     {
         return(Json(new { success = false, message = CommonMsg.Fail(EntityNames.User, En_CRUD.Delete) }));
     }
 }
 public JsonResult DeleteEmbroideryFirmPricing(int id)
 {
     try
     {
         bool Result = new EmbroideryFirmPriceSettingsBL().Delete(id);
         if (Result == true)
         {
             return(Json(new { success = true, message = CommonMsg.Success(EntityNames.EmbroideryFirmPricing, En_CRUD.Delete) }));
         }
         else
         {
             return(Json(new { success = false, message = CommonMsg.DependancyError() }));
         }
     }
     catch (Exception ex)
     {
         return(Json(new { success = false, message = CommonMsg.Fail(EntityNames.EmbroideryFirmPricing, En_CRUD.Delete) }));
     }
 }