public void updateData(AcademicService data) { var q = (from p in db.AcademicServices where p.UserName == username where p.DurationId == durationId where p.AcademicServiceId == data.AcademicServiceId select p).First(); q.AcademicServiceTypeId = data.AcademicServiceTypeId; q.ValueOfService = data.ValueOfService; db.SubmitChanges(); }
protected void btnSave_Click(object sender, EventArgs e) { AcademicService acs = new AcademicService(); acs.UserName = HttpContext.Current.User.Identity.Name; acs.DurationId = dm.getDurationId(); acs.AcademicServiceTypeId = Convert.ToInt32(ddAcademicServiceType.SelectedValue); acs.ValueOfService = Convert.ToInt32(txtTimes.Text); acs.Description = txtDesc.Text; db.AcademicServices.InsertOnSubmit(acs); db.SubmitChanges(); }
protected void ASPxGridView1_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { AcademicService acs = new AcademicService(); acs.AcademicServiceId = Convert.ToInt32(((HiddenField)ASPxGridView1.FindEditRowCellTemplateControl((GridViewDataColumn)ASPxGridView1.Columns["AcademicServiceTypeId"], "hidEditId")).Value); acs.AcademicServiceTypeId = Convert.ToInt32(((ASPxComboBox)ASPxGridView1.FindEditRowCellTemplateControl((GridViewDataColumn)ASPxGridView1.Columns["AcademicServiceTypeId"], "ddEditAcademicServiceTypeId")).Value); acs.ValueOfService = Convert.ToInt32(((ASPxSpinEdit)ASPxGridView1.FindEditRowCellTemplateControl((GridViewDataColumn)ASPxGridView1.Columns["ValueOfService"], "txtEditValueOfService")).Text); dll_AcademicService dll = new dll_AcademicService(username, durationId); dll.updateData(acs); this.ASPxGridView1.CancelEdit(); e.Cancel = true; FillGridView(); }
protected void ASPxGridView1_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { AcademicService acs = new AcademicService(); acs.UserName = username; acs.DurationId = durationId; acs.AcademicServiceTypeId = Convert.ToInt32(((ASPxComboBox)ASPxGridView1.FindEditRowCellTemplateControl((GridViewDataColumn)ASPxGridView1.Columns["AcademicServiceTypeId"], "ddEditAcademicServiceTypeId")).Value); acs.ValueOfService = Convert.ToInt32(((TextBox)ASPxGridView1.FindEditRowCellTemplateControl((GridViewDataColumn)ASPxGridView1.Columns["ValueOfService"], "txtEditValueOfService")).Text); dll_AcademicService dll = new dll_AcademicService(username, durationId); dll.insertData(acs); e.Cancel = true; ASPxGridView1.CancelEdit(); FillGridView(); }
public AcademicController(AcademicService academicService) { _academicService = academicService; }
public void insertData(AcademicService data) { db.AcademicServices.InsertOnSubmit(data); db.SubmitChanges(); }
public GradesAdapter() { _db = AcademicService.GetInstance; _dbUsers = UserDBService.GetInstance; }
public AcademicsController(AcademicService academicService, CoursesTypeService coursesService) { _academicService = academicService; _coursesService = coursesService; }