public bool DeletePartyType(long party_type_id, long updated_by) { try { party_type oPartyType = _entities.party_type.FirstOrDefault(c => c.party_type_id == party_type_id); oPartyType.is_deleted = true; oPartyType.updated_by = updated_by; oPartyType.updated_date = DateTime.Now; _entities.SaveChanges(); return(true); } catch (Exception ex) { return(false); } }
public bool UpdatePartyType(party_type oPartyType, long updated_by) { try { party_type con = _entities.party_type.Find(oPartyType.party_type_id); con.party_type_name = oPartyType.party_type_name; con.party_prefix = oPartyType.party_prefix; con.updated_by = updated_by; con.updated_date = DateTime.Now; con.is_active = oPartyType.is_active; con.is_deleted = oPartyType.is_deleted = false; _entities.SaveChanges(); return(true); } catch (Exception ex) { return(false); } }
public bool InsertPartyType(party_type oPartyType, long created_by) { try { party_type insert_party_type = new party_type { party_type_name = oPartyType.party_type_name, party_prefix = oPartyType.party_prefix, created_by = created_by, created_date = DateTime.Now, is_deleted = oPartyType.is_deleted = false, is_active = oPartyType.is_active = true }; _entities.party_type.Add(insert_party_type); _entities.SaveChanges(); return(true); } catch (Exception ex) { return(false); } }