Exemplo n.º 1
0
        public Courses(ICourseService courseService,Course course)
        {
            _course = course;
            _courseService = courseService;
            InitializeComponent();

               // dgvList.AutoGenerateColumns = false;
        }
Exemplo n.º 2
0
 private void btnCreate_Click(object sender, EventArgs e)
 {
     _course = new Course();
     _course.Name = txtName.Text;
     _course.Description = txtDescription.Text;
     _course.Fees = float.Parse(txtFee.Text);
     _course.Duration = txtDuration.Text;
     _courseService.Create(_course);
 }
Exemplo n.º 3
0
 private Dictionary<String, String> Mapper(Course entity)
 {
     Dictionary<String, String> _parameters = new Dictionary<string, string>();
     PropertyInfo[] properties = typeof(Course).GetProperties();
     foreach (PropertyInfo property in properties)
     {
         _parameters.Add(property.Name, Convert.ToString(property.GetValue(entity)));
     }
     return _parameters;
 }
Exemplo n.º 4
0
 public int Update(Course entity)
 {
     Dictionary<String, string> _parameters = new Dictionary<string, string>();
     _parameters.Add("Id", Convert.ToString(entity.Id));
     _parameters.Add("Name", entity.Name);
     _parameters.Add("Duration", entity.Duration);
     _parameters.Add("Fee", Convert.ToString(entity.Fees));
     _parameters.Add("Description", entity.Description);
     return _database.Update("sp_UpdateCourse", _parameters);
 }
Exemplo n.º 5
0
 public int Update(Course course)
 {
     return _courseRepository.Update(course);
 }
Exemplo n.º 6
0
 public int Create(Course course)
 {
     return _courseRepository.Create(course);
 }