protected void RadGrid1_InsertCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
 {
     GridEditableItem editedItem = e.Item as GridEditableItem;
     UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);
     Rab rab = new Rab();
     rab.KaCode = (userControl.FindControl("cmbKaCode") as RadComboBox).SelectedValue.Trim();
     rab.Rab = Convert.ToDecimal((userControl.FindControl("txtRab") as RadNumericTextBox).Value);
     rab.PeriodId = Convert.ToInt32(HttpContext.Current.Session["_periodeId"]);
     rab.Save();
 }
 protected void RadGrid1_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
 {
     int id = 0;
     GridEditableItem editedItem = e.Item as GridEditableItem;
     UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);
     id = Convert.ToInt32((userControl.FindControl("txtId") as RadTextBox).Text.Trim());
     Rab rab = new Rab();
     if (rab.LoadByPrimaryKey(id))
     {
         rab.Rab = Convert.ToDecimal((userControl.FindControl("txtRab") as RadNumericTextBox).Value);
         rab.Save();
     }
 }
Пример #3
0
 virtual public Rab AttachEntity(Rab entity)
 {
     return(base.AttachEntity(entity) as Rab);
 }