Example #1
0
        protected void RadGrid1_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
        {
            Int32 KasId = 0;
            GridEditableItem editedItem = e.Item as GridEditableItem;
            UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);
            Kas kas = new Kas();
            KasId = Convert.ToInt32((userControl.FindControl("txtBkuId") as RadTextBox).Text.Trim());
            if (kas.LoadByPrimaryKey(KasId))
            {
                kas.KaName = (userControl.FindControl("txtKaName") as RadTextBox).Text.Trim();
                kas.SaldoAwal = Convert.ToDecimal((userControl.FindControl("txtSaldo") as RadTextBox).Text.Trim());
                kas.Save();
            }

            MutasiKasQuery mkQ = new MutasiKasQuery();
            mkQ.SelectAll();
            mkQ.Where(mkQ.Code == "0.0.1", mkQ.PeriodId == (Int32)HttpContext.Current.Session["_periodeId"]);            
            MutasiKasCollection mkC = new MutasiKasCollection();
            mkC.Load(mkQ);
            if (mkC.Count > 0)
            {
                KasQuery kasQ = new KasQuery();
                kasQ.Select(kasQ.SaldoAwal.Sum());
                kasQ.Where(kasQ.PeriodeId == (Int32)HttpContext.Current.Session["_periodeId"]);
            }
        }
Example #2
0
 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);
     Kas kas = new Kas();
     kas.KaCode = (userControl.FindControl("txtKasCode") as RadTextBox).Text.Trim().ToUpper();
     kas.KaName = (userControl.FindControl("txtKaName") as RadTextBox).Text.Trim().ToUpper();
     kas.SaldoAwal = Convert.ToDecimal((userControl.FindControl("txtSaldo") as RadTextBox).Text.Trim());
     kas.PeriodeId = Convert.ToInt32(HttpContext.Current.Session["_periodeId"]);
     kas.Save();
 }
Example #3
0
 protected void RadGrid1_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
 {
     Int32 KasId = 0;
     GridEditableItem editedItem = e.Item as GridEditableItem;
     UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);
     Kas kas = new Kas();
     KasId = Convert.ToInt32((userControl.FindControl("txtBkuId") as RadTextBox).Text.Trim());
     if (kas.LoadByPrimaryKey(KasId))
     {
         kas.KaName = (userControl.FindControl("txtKaName") as RadTextBox).Text.Trim().ToUpper();
         kas.SaldoAwal = Convert.ToDecimal((userControl.FindControl("txtSaldo") as RadTextBox).Text.Trim());
         kas.Save();
     }
 }
Example #4
0
 //Verify Routine, memanfaatkan event delete
 protected void RadGrid1_DeleteCommand(object source, GridCommandEventArgs e)
 {
     long IdKas = (long)e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["id"];
    
     Kas kas = new Kas();
     if (kas.LoadByPrimaryKey(IdKas))
     {
         kas.IsVerified = true;
         kas.Save();
     }
 }