private void radGridView1_UserDeletingRow(object sender, Telerik.WinControls.UI.GridViewRowCancelEventArgs e) { //Remove data from database using (sinarekDataSetTableAdapters.producttotaluserTableAdapter tbl = new sinarekDataSetTableAdapters.producttotaluserTableAdapter()) { try { tbl.DeleteProductTotalUser(int.Parse(e.Rows[0].Cells["totalid"].Value.ToString())); } catch (Exception ex) { MessageBox.Show("Ada masalah dengan penghapusan sisa barang.", "SMS - Error Notification"); e.Cancel = true; } } }
private void SaveNewItem() { if (validateFields()) { using (sinarekDataSetTableAdapters.producttotaluserTableAdapter tbl = new sinarekDataSetTableAdapters.producttotaluserTableAdapter()) { try { tbl.InsertProductTotalUSer(dtpTanggal.Value , "" , int.Parse(rddProduct.SelectedValue.ToString()) , decimal.Parse(txtSisa.Value.ToString()) , user_); } catch (Exception ex) { MessageBox.Show(rddProduct.Text + " sudah terinput.", "SMS - Error Notification"); } } } }