public ProfessionEditFm(Utils.Operation operation, ProfessionsDTO profession) { InitializeComponent(); professionService = Program.kernel.Get <IProfessionService>(); this.operation = operation; professionBS.DataSource = Item = profession; professionNameTBox.DataBindings.Add("EditValue", professionBS, "ProfessionName"); }
public bool ProfessionDelete(ProfessionsDTO pdto) { try { Professions.Delete(Professions.GetAll().FirstOrDefault(c => c.Id == pdto.Id)); return(true); } catch (Exception ex) { return(false); } }
public void ProfessionUpdate(ProfessionsDTO pdto) { var model = Professions.GetAll().SingleOrDefault(c => c.Id == pdto.Id); Professions.Update((mapper.Map <ProfessionsDTO, Professions>(pdto, model))); }
public int ProfessionCreate(ProfessionsDTO pdto) { var createrecord = Professions.Create(mapper.Map <Professions>(pdto)); return((int)createrecord.Id); }