示例#1
0
 private void frmAppSettingUpdate_FormClosed(object sender, FormClosedEventArgs e)
 {
     if (this.DialogResult == DialogResult.OK)
     {
         if (this.Caller is frmAppSettingBrowse)
         {
             frmAppSettingBrowse frmCaller = (frmAppSettingBrowse)this.Caller;
             frmCaller.RefreshData();
             frmCaller.FindRow("RowID", RowID.ToString());
         }
     }
 }
示例#2
0
 private void cmdSave_Click(object sender, EventArgs e)
 {
     try
     {
         using (Database db = new Database())
         {
             db.Open();
             DataTable dt = new DataTable();
             if (formMode == enumFormMode.NEW)
             {
                 db.Commands.Add(db.CreateCommand("[USP_APPSETTING_INSERT]"));
             }
             else
             {
                 db.Commands.Add(db.CreateCommand("[USP_APPSETTING_UPDATE]"));
             }
             db.Commands[0].Parameters.Add(new Parameter("@Key", SqlDbType.VarChar, txtKey.Text));
             db.Commands[0].Parameters.Add(new Parameter("@Keterangan", SqlDbType.VarChar, txtKeterangan.Text));
             db.Commands[0].Parameters.Add(new Parameter("@Value", SqlDbType.VarChar, txtValue.Text));
             db.Commands[0].Parameters.Add(new Parameter("@RowID", SqlDbType.UniqueIdentifier, RowID));
             db.Commands[0].Parameters.Add(new Parameter("@LastUpdateBy", SqlDbType.VarChar, SecurityManager.UserName));
             db.Commands[0].ExecuteNonQuery();
             db.Close();
             db.Dispose();
         }
         this.DialogResult = DialogResult.OK;
         frmAppSettingBrowse frmcaller = (frmAppSettingBrowse)this.Caller;
         frmcaller.RefreshData();
         this.Close();
         frmcaller.Show();
     }
     catch (Exception ex)
     {
         Error.LogError(ex);
     }
 }