public IActionResult EditZoneType(ZoneTypeRelation zoneTypeRelation) { try { Validator.validateZoneRel(zoneTypeRelation); DAZone dAZone = new DAZone(); return(this.OKResponse(dAZone.EditZoneType(zoneTypeRelation, _context, User.ToAppUser()) ? "Updated Successfully" : "updation Failed")); } catch (DataValidationException ex) { return(this.KnowOperationError(ex.Message)); } }
public static void validateZoneRel(ZoneTypeRelation zoneTypeRelation) { if (zoneTypeRelation.Relationid == 0) { throw new DataValidationException($"Relationid does not exists"); } if (zoneTypeRelation.Zoneid == 0) { throw new DataValidationException($"Zoneid does not exists"); } if (zoneTypeRelation.Typeid == 0) { throw new DataValidationException($"Typeid does not exists"); } if (string.IsNullOrEmpty(zoneTypeRelation.Paymentmode)) { throw new DataValidationException($"Paymentmode does not exists"); } if (string.IsNullOrEmpty(zoneTypeRelation.Showbill)) { throw new DataValidationException($"Showbill does not exists"); } }
public IActionResult DefaultZoneType(long zoneid, long typeid, ZoneTypeRelation zoneTypeRelation) { DAZone dAZone = new DAZone(); return(this.OKResponse(dAZone.IsDefaultZoneType(zoneid, typeid, _context, User.ToAppUser()) ? "Updated Successfully" : "updation Failed")); }
public IActionResult ActiveZoneType(long zoneid, long typeid, bool isactivestatus, ZoneTypeRelation zoneTypeRelation) { try { DAZone dAZone = new DAZone(); return(this.OKResponse(dAZone.ActiveZoneType(zoneid, typeid, isactivestatus, _context, User.ToAppUser()) ? "Active Successfully" : "InActive Successfully")); } catch (DataValidationException ex) { return(this.KnowOperationError(ex.Message)); } }