public void updateData(StdDevelopment data)
        {
            var q = (from p in db.StdDevelopments
                    where p.UserName == username
                    where p.DurationId == durationId
                     where p.StdDevId == data.StdDevId
                    select p).First();

            q.StdDevTypeId = data.StdDevTypeId;
            q.ValueOfStdDev = data.ValueOfStdDev;

            db.SubmitChanges();
        }
        protected void ASPxGridView1_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            StdDevelopment sd = new StdDevelopment();

            sd.StdDevId = Convert.ToInt32(((HiddenField)ASPxGridView1.FindEditRowCellTemplateControl((GridViewDataColumn)ASPxGridView1.Columns["StdDevTypeId"], "hidEditId")).Value);
            sd.ValueOfStdDev = Convert.ToInt32(((ASPxSpinEdit)ASPxGridView1.FindEditRowCellTemplateControl((GridViewDataColumn)ASPxGridView1.Columns["ValueOfStdDev"], "txtEditValueOfStdDev")).Text);
            sd.StdDevTypeId = Convert.ToInt32(((ASPxComboBox)ASPxGridView1.FindEditRowCellTemplateControl((GridViewDataColumn)ASPxGridView1.Columns["StdDevTypeId"], "ddEditStdDevTypeId")).Value);

            dll_StudentDevelopment dll = new dll_StudentDevelopment(username, dr.getDurationId());
            dll.updateData(sd);
            this.ASPxGridView1.CancelEdit();
            e.Cancel = true;
            FillGridView();
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            StdDevelopment sd = new StdDevelopment();

            sd.UserName = HttpContext.Current.User.Identity.Name;
            sd.DurationId = dm.getDurationId();

            sd.StdDevTypeId = Convert.ToInt32(ddStdDevType.SelectedValue);
            sd.ValueOfStdDev = Convert.ToInt32(txtCount.Text);
            sd.Description = txtDesc.Text;

            db.StdDevelopments.InsertOnSubmit(sd);
            db.SubmitChanges();
        }
        protected void ASPxGridView1_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
        {
            StdDevelopment sd = new StdDevelopment();

            sd.UserName = username;
            sd.DurationId = durationId;

            sd.ValueOfStdDev = Convert.ToInt32(((TextBox)ASPxGridView1.FindEditRowCellTemplateControl((GridViewDataColumn)ASPxGridView1.Columns["ValueOfStdDev"], "txtEditValueOfStdDev")).Text);
            sd.StdDevTypeId = Convert.ToInt32(((ASPxComboBox)ASPxGridView1.FindEditRowCellTemplateControl((GridViewDataColumn)ASPxGridView1.Columns["StdDevTypeId"], "ddEditStdDevTypeId")).Value);

            dll_StudentDevelopment dll = new dll_StudentDevelopment(username, durationId);
            dll.insertData(sd);
            e.Cancel = true;
            ASPxGridView1.CancelEdit();
            FillGridView();
        }
 public void insertData(StdDevelopment data)
 {
     db.StdDevelopments.InsertOnSubmit(data);
     db.SubmitChanges();
 }