public bool InsertDealerType(dealer_type objDealerType, long created_by) { try { _entities.dealer_type.Add(objDealerType); _entities.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool DeleteDealerType(long dealer_type_id, long updated_by) { try { dealer_type objDealerType = _entities.dealer_type.FirstOrDefault(c => c.dealer_type_id == dealer_type_id); _entities.dealer_type.Attach(objDealerType); _entities.dealer_type.Remove(objDealerType); _entities.SaveChanges(); return(true); } catch (Exception) { return(false); } }
public bool UpdateDealerType(dealer_type objDealerType, long updated_by) { try { dealer_type con = _entities.dealer_type.Find(objDealerType.dealer_type_id); con.dealer_type_name = objDealerType.dealer_type_name; con.dealer_type_prefix = objDealerType.dealer_type_prefix; con.credit_limit = objDealerType.credit_limit; con.updated_by = updated_by; con.updated_date = DateTime.Now; con.is_active = objDealerType.is_active; con.is_deleted = objDealerType.is_deleted = false; _entities.SaveChanges(); return(true); } catch (Exception ex) { return(false); } }