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");
        }
Example #2
0
 public bool  ProfessionDelete(ProfessionsDTO pdto)
 {
     try
     {
         Professions.Delete(Professions.GetAll().FirstOrDefault(c => c.Id == pdto.Id));
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Example #3
0
        public void  ProfessionUpdate(ProfessionsDTO pdto)
        {
            var model = Professions.GetAll().SingleOrDefault(c => c.Id == pdto.Id);

            Professions.Update((mapper.Map <ProfessionsDTO, Professions>(pdto, model)));
        }
Example #4
0
        public int  ProfessionCreate(ProfessionsDTO pdto)
        {
            var createrecord = Professions.Create(mapper.Map <Professions>(pdto));

            return((int)createrecord.Id);
        }