private void frmKonsinyasiUpdate_Load(object sender, EventArgs e) { try { this.Cursor = Cursors.WaitCursor; DataTable dt = FillComboBox.DBGetCabang(""); dt.DefaultView.Sort = "NamaPanjang ASC"; cboCabang.DisplayMember = "NamaPanjang"; cboCabang.ValueMember = "CabangID"; cboCabang.DataSource = dt.DefaultView; DataTable dt2 = FillComboBox.DBGetMataUang(Guid.Empty, ""); dt2.DefaultView.Sort = "MataUangID ASC"; cboMataUang.DisplayMember = "MataUangID"; cboMataUang.ValueMember = "MataUangID"; cboMataUang.DataSource = dt2.DefaultView; if (mode == FormMode.New) { lookUpStokMotor1.txtNopol.Text = ""; txtTanggal.DateValue = GlobalVar.GetServerDate; txtHarga.Text = "0"; DataTable dummyMU = new DataTable(); using (Database dbsubMU = new Database()) { dbsubMU.Commands.Add(dbsubMU.CreateCommand("usp_AppSetting_LIST")); dbsubMU.Commands[0].Parameters.Add(new Parameter("@key", SqlDbType.VarChar, "DEFMATAUANG")); dummyMU = dbsubMU.Commands[0].ExecuteDataTable(); cboMataUang.Text = dummyMU.Rows[0]["Value"].ToString(); } } else { DataTable _dt = new DataTable(); using (Database db = new Database()) { db.Commands.Add(db.CreateCommand("usp_Konsinyasi_LIST")); db.Commands[0].Parameters.Add(new Parameter("@RowID", SqlDbType.UniqueIdentifier, _rowID)); db.Commands[0].Parameters.Add(new Parameter("@CabangID", SqlDbType.VarChar, _cabangID)); _dt = db.Commands[0].ExecuteDataTable(); } lblNoBukti.Text = Tools.isNull(_dt.Rows[0]["Bukti"], "").ToString(); _pembRowID = (Guid)Tools.isNull(_dt.Rows[0]["PembRowID"], Guid.Empty); lookUpStokMotor1.txtNopol.Text = Tools.isNull(_dt.Rows[0]["Nopol"], "").ToString(); txtTanggal.DateValue = (DateTime)Tools.isNull(_dt.Rows[0]["Tanggal"], DateTime.MinValue); cboMataUang.Text = Tools.isNull(_dt.Rows[0]["MataUangID"], "").ToString(); txtHarga.Text = Tools.isNull(_dt.Rows[0]["Harga"], "").ToString(); cboCabang.Text = Tools.isNull(_dt.Rows[0]["CabangPenerima"], "").ToString(); } } catch (Exception ex) { Error.LogError(ex); } finally { this.Cursor = Cursors.Default; } }