private void GetDialogResult(frmNotaPiutangLookup dialogForm) { if (GlobalVar.Gudang != "2803") { this.kpid = dialogForm.RowID; DataTable dtTagihan = cekNoRegNota(); if (dtTagihan.Rows.Count > 0) { this.TextBox.Text = dialogForm.NoNota; this.tglJTempo = dialogForm.TglJatuhTempo; this.rpNota = dialogForm.RpNota; this.rpTagih = dialogForm.RpTagih; this.kprecid = dialogForm.RecordID; this.jenis = dialogForm.Jenis; this.tagihDetailID = (Guid)dtTagihan.Rows[0]["RowID"]; this.tagihDetailRecID = dtTagihan.Rows[0]["RecordID"].ToString(); } else { this.kpid = Guid.Empty; MessageBox.Show("Nota belum terdaftar di register."); TextBox.Focus(); } if (this.SelectData != null) { this.SelectData(this, new EventArgs()); } } else { this.kpid = dialogForm.RowID; //DataTable dtTagihan = cekNoRegNota(); //if (dtTagihan.Rows.Count > 0) //{ this.TextBox.Text = dialogForm.NoNota; this.tglJTempo = dialogForm.TglJatuhTempo; this.rpNota = dialogForm.RpNota; this.rpTagih = dialogForm.RpTagih; this.kprecid = dialogForm.RecordID; this.jenis = dialogForm.Jenis; this.tagihDetailID = Guid.NewGuid(); this.tagihDetailRecID = Tools.CreateFingerPrint(GlobalVar.PerusahaanID, SecurityManager.UserInitial); //this.tagihDetailID = (Guid)dtTagihan.Rows[0]["RowID"]; //this.tagihDetailRecID = dtTagihan.Rows[0]["RecordID"].ToString(); //} //else //{ // this.kpid = Guid.Empty; // MessageBox.Show("Nota belum terdaftar di register."); // TextBox.Focus(); //} if (this.SelectData != null) { this.SelectData(this, new EventArgs()); } } }
private void ShowDialogForm() { try { DataTable dt = new DataTable(); using (Database db = new Database(GlobalVar.DBFinance)) { db.Commands.Add(db.CreateCommand("usp_LookUp_NotaToko_KartuPiutang")); db.Commands[0].Parameters.Add(new Parameter("@KodeToko", SqlDbType.VarChar, kodeToko)); if (TextBox.Text != "") { db.Commands[0].Parameters.Add(new Parameter("@str", SqlDbType.VarChar, TextBox.Text)); } dt = db.Commands[0].ExecuteDataTable(); } frmNotaPiutangLookup ifrmDialog = new frmNotaPiutangLookup(dt); ifrmDialog.ShowDialog(); if (ifrmDialog.DialogResult == DialogResult.OK) { GetDialogResult(ifrmDialog); } } catch (Exception ex) { Error.LogError(ex); } }