private void txtKeterangan_KeyPress(object sender, KeyPressEventArgs e) { if (KeyPressHelper.IsEnter(e)) { gridControl.Focus(); GridListControlHelper.SetCurrentCell(gridControl, 1, 2); // fokus ke kolom nama produk } }
private void InitGridList() { var gridListProperties = new List <GridListControlProperties>(); gridListProperties.Add(new GridListControlProperties { Header = "No", Width = 30 }); var listCount = 0; switch (this._referensiType) { case ReferencesType.Customer: gridListProperties.Add(new GridListControlProperties { Header = "Nama Customer", Width = 200 }); gridListProperties.Add(new GridListControlProperties { Header = "Alamat" }); GridListControlHelper.InitializeGridListControl <Customer>(this.gridList, _listOfCustomer, gridListProperties); this.gridList.Grid.QueryCellInfo += GridCustomer_QueryCellInfo; listCount = _listOfCustomer.Count; break; case ReferencesType.Produk: gridListProperties.Add(new GridListControlProperties { Header = "Kode Produk", Width = 100 }); gridListProperties.Add(new GridListControlProperties { Header = "Nama Produk", Width = 260 }); gridListProperties.Add(new GridListControlProperties { Header = "Harga", Width = 70 }); gridListProperties.Add(new GridListControlProperties { Header = "Stok", Width = 50 }); gridListProperties.Add(new GridListControlProperties { Header = "Golongan" }); GridListControlHelper.InitializeGridListControl <Produk>(this.gridList, _listOfProduk, gridListProperties); this.gridList.Grid.QueryCellInfo += GridProduk_QueryCellInfo; listCount = _listOfProduk.Count; break; default: break; } if (listCount > 0) { this.gridList.SetSelected(0, true); } }
private void InitGridList() { var gridListProperties = new List <GridListControlProperties>(); gridListProperties.Add(new GridListControlProperties { Header = "No", Width = 30 }); gridListProperties.Add(new GridListControlProperties { Header = "Hak Akses", Width = 400 }); gridListProperties.Add(new GridListControlProperties { Header = "Status", Width = 100 }); GridListControlHelper.InitializeGridListControl <Role>(this.gridList, _listOfRole, gridListProperties); if (_listOfRole.Count > 0) { this.gridList.SetSelected(0, true); HandleSelectionChanged(this.gridList); } this.gridList.Grid.QueryCellInfo += delegate(object sender, GridQueryCellInfoEventArgs e) { if (_listOfRole.Count > 0) { if (e.RowIndex > 0) { var rowIndex = e.RowIndex - 1; if (rowIndex < _listOfRole.Count) { var role = _listOfRole[rowIndex]; switch (e.ColIndex) { case 2: e.Style.CellValue = role.nama_role; break; case 3: e.Style.CellValue = role.is_active ? "Aktif" : "Non Aktif"; e.Style.HorizontalAlignment = GridHorizontalAlignment.Center; break; default: break; } // we handled it, let the grid know e.Handled = true; } } } }; }
private void LoadData() { using (new StCursor(Cursors.WaitCursor, new TimeSpan(0, 0, 0, 0))) { _listOfPengeluaran = _bll.GetAll(); GridListControlHelper.Refresh <PengeluaranBiaya>(this.gridList, _listOfPengeluaran); } ResetButton(); }
private void LoadData(string customerName) { using (new StCursor(Cursors.WaitCursor, new TimeSpan(0, 0, 0, 0))) { _listOfPembayaranPiutang = _bll.GetByName(customerName); GridListControlHelper.Refresh <PembayaranPiutangProduk>(this.gridList, _listOfPembayaranPiutang); } ResetButton(); }
private void LoadData(string supplierName) { using (new StCursor(Cursors.WaitCursor, new TimeSpan(0, 0, 0, 0))) { _listOfBeli = _bll.GetByName(supplierName); GridListControlHelper.Refresh <BeliProduk>(this.gridList, _listOfBeli); } ResetButton(); }
private void LoadData() { using (new StCursor(Cursors.WaitCursor, new TimeSpan(0, 0, 0, 0))) { _listOfJual = _bll.GetAll(); GridListControlHelper.Refresh <JualProduk>(this.gridList, _listOfJual); } ResetButton(); }
private void LoadData(DateTime tanggalMulai, DateTime tanggalSelesai) { using (new StCursor(Cursors.WaitCursor, new TimeSpan(0, 0, 0, 0))) { _listOfJual = _bll.GetByTanggal(tanggalMulai, tanggalSelesai); GridListControlHelper.Refresh <JualProduk>(this.gridList, _listOfJual); } ResetButton(); }
private void LoadDataProdukByName(string name) { using (new StCursor(Cursors.WaitCursor, new TimeSpan(0, 0, 0, 0))) { _listOfProduk = _bll.GetByName(name); GridListControlHelper.Refresh <Produk>(this.gridList, _listOfProduk); } ResetButton(); }
private void LoadData(int bulan, int tahun) { using (new StCursor(Cursors.WaitCursor, new TimeSpan(0, 0, 0, 0))) { _listOfGaji = _bll.GetByBulanAndTahun(bulan, tahun); GridListControlHelper.Refresh <GajiKaryawan>(this.gridList, _listOfGaji); } ResetButton(); }
private void InitGridList() { var gridListProperties = new List <GridListControlProperties>(); gridListProperties.Add(new GridListControlProperties { Header = "No", Width = 30 }); gridListProperties.Add(new GridListControlProperties { Header = "Golongan", Width = 700 }); gridListProperties.Add(new GridListControlProperties { Header = "Diskon" }); GridListControlHelper.InitializeGridListControl <Golongan>(this.gridList, _listOfGolongan, gridListProperties); if (_listOfGolongan.Count > 0) { this.gridList.SetSelected(0, true); } this.gridList.Grid.QueryCellInfo += delegate(object sender, GridQueryCellInfoEventArgs e) { if (_listOfGolongan.Count > 0) { if (e.RowIndex > 0) { var rowIndex = e.RowIndex - 1; if (rowIndex < _listOfGolongan.Count) { var golongan = _listOfGolongan[rowIndex]; switch (e.ColIndex) { case 2: e.Style.CellValue = golongan.nama_golongan; break; case 3: e.Style.HorizontalAlignment = GridHorizontalAlignment.Center; e.Style.CellValue = golongan.diskon; break; default: break; } // we handled it, let the grid know e.Handled = true; } } } }; }
private void LoadData(string customerName) { using (new StCursor(Cursors.WaitCursor, new TimeSpan(0, 0, 0, 0))) { _listOfCustomer = _bll.GetByName(customerName); GridListControlHelper.Refresh <Customer>(this.gridList, _listOfCustomer); } ResetButton(); }
private void LoadData(bool isReseller) { using (new StCursor(Cursors.WaitCursor, new TimeSpan(0, 0, 0, 0))) { _listOfCustomer = _bll.GetAll(isReseller); GridListControlHelper.Refresh <Customer>(this.gridList, _listOfCustomer); } ResetButton(); }
private void InitGridList() { var gridListProperties = new List <GridListControlProperties>(); gridListProperties.Add(new GridListControlProperties { Header = "No", Width = 30 }); gridListProperties.Add(new GridListControlProperties { Header = "Nama Kartu", Width = 600 }); gridListProperties.Add(new GridListControlProperties { Header = "Keterangan" }); GridListControlHelper.InitializeGridListControl <Kartu>(this.gridList, _listOfKartu, gridListProperties); if (_listOfKartu.Count > 0) { this.gridList.SetSelected(0, true); } this.gridList.Grid.QueryCellInfo += delegate(object sender, GridQueryCellInfoEventArgs e) { if (_listOfKartu.Count > 0) { if (e.RowIndex > 0) { var rowIndex = e.RowIndex - 1; if (rowIndex < _listOfKartu.Count) { var kartu = _listOfKartu[rowIndex]; switch (e.ColIndex) { case 2: e.Style.CellValue = kartu.nama_kartu; break; case 3: e.Style.CellValue = kartu.is_debit ? "Kartu Debit" : "Kartu Kredit"; break; default: break; } // we handled it, let the grid know e.Handled = true; } } } }; }
private void InitGridList() { var gridListProperties = new List <GridListControlProperties>(); gridListProperties.Add(new GridListControlProperties { Header = "No", Width = 30 }); gridListProperties.Add(new GridListControlProperties { Header = "Nama Grup Pelanggan", Width = 400 }); gridListProperties.Add(new GridListControlProperties { Header = "Deskripsi", Width = 700 }); GridListControlHelper.InitializeGridListControl <GrupCustomer>(this.gridList, _listOfCrupCustomer, gridListProperties); if (_listOfCrupCustomer.Count > 0) { this.gridList.SetSelected(0, true); } this.gridList.Grid.QueryCellInfo += delegate(object sender, GridQueryCellInfoEventArgs e) { if (_listOfCrupCustomer.Count > 0) { if (e.RowIndex > 0) { var rowIndex = e.RowIndex - 1; if (rowIndex < _listOfCrupCustomer.Count) { var grupCustomer = _listOfCrupCustomer[rowIndex]; switch (e.ColIndex) { case 2: e.Style.CellValue = grupCustomer.nama_grup; break; case 3: e.Style.CellValue = grupCustomer.deskripsi; break; default: break; } // we handled it, let the grid know e.Handled = true; } } } }; }
public void Ok(object sender, object data) { if (data is Produk) // pencarian produk baku { var produk = (Produk)data; double diskon = 0; if (_customer != null) { diskon = _customer.diskon; } if (!(diskon > 0)) { diskon = produk.diskon > 0 ? produk.diskon : produk.Golongan.diskon; } SetItemProduk(this.gridControl, _rowIndex, _colIndex + 1, produk, diskon: diskon); this.gridControl.Refresh(); RefreshTotal(); if (this.gridControl.RowCount == _rowIndex) { _listOfItemJual.Add(new ItemJualProduk()); this.gridControl.RowCount = _listOfItemJual.Count; } GridListControlHelper.SetCurrentCell(this.gridControl, _rowIndex + 1, 2); // pindah kebaris berikutnya } else if (data is Customer) // pencarian customer { this._customer = (Customer)data; txtCustomer.Text = this._customer.nama_customer; KeyPressHelper.NextFocus(); } else if (data is AlamatKirim) { var alamatKirim = (AlamatKirim)data; if (this._jual == null) { this._jual = new JualProduk(); } this._jual.is_sdac = alamatKirim.is_sdac; this._jual.kirim_kepada = alamatKirim.kepada; this._jual.kirim_alamat = alamatKirim.alamat; this._jual.kirim_kecamatan = alamatKirim.kecamatan; this._jual.kirim_kelurahan = alamatKirim.kelurahan; this._jual.kirim_kota = alamatKirim.kota; this._jual.kirim_kode_pos = alamatKirim.kode_pos; this._jual.kirim_telepon = alamatKirim.telepon; } }
private void LoadData() { using (new StCursor(Cursors.WaitCursor, new TimeSpan(0, 0, 0, 0))) { _listOfDropshipper = _bll.GetAll(); GridListControlHelper.Refresh <Dropshipper>(this.gridList, _listOfDropshipper); } ResetButton(); }
public void Ok(object sender, bool isNewData, object data) { var dropshipper = (Dropshipper)data; if (isNewData) { GridListControlHelper.AddObject<Dropshipper>(this.gridList, _listOfDropshipper, dropshipper); ResetButton(); } else GridListControlHelper.UpdateObject<Dropshipper>(this.gridList, _listOfDropshipper, dropshipper); }
private void CekOngkir() { var key = MainProgram.rajaOngkirKey; // api key raja ongkir var baseUrl = "http://api.rajaongkir.com/starter/"; var client = new RestClient(); client.BaseUrl = new Uri(baseUrl); // versi gratis raja ongkir, hanya mendukung pengecekan jne, tiki dan pos var listOfKurir = new string[] { "jne", "tiki", "pos" }; _listOfCost.Clear(); foreach (var kurir in listOfKurir) { var request = new RestRequest("cost", Method.POST); request.AddHeader("key", key); request.AddHeader("content-type", "application/x-www-form-urlencoded"); var query = new query { origin = _kabupatenAsal.kabupaten_id.ToString(), destination = _kabupatenTujuan.kabupaten_id.ToString(), weight = (int)NumberHelper.StringToDouble(txtBerat.Text), courier = kurir }; request.RequestFormat = DataFormat.Json; request.AddJsonBody(query); try { var response = client.Execute(request); var ongkir = JsonConvert.DeserializeObject <root>(response.Content); if (ongkir.rajaongkir.results[0].costs.Count > 0) { foreach (var costs in ongkir.rajaongkir.results[0].costs) { costs.kurir_code = kurir.ToUpper(); _listOfCost.Add(costs); } } } catch { } } GridListControlHelper.Refresh <costs>(this.gridList, _listOfCost); base.SetActiveBtnPilih(_listOfCost.Count > 0); }
private void LoadData(DateTime tanggalMulai, DateTime tanggalSelesai) { using (new StCursor(Cursors.WaitCursor, new TimeSpan(0, 0, 0, 0))) { _listOfKasbon = _bll.GetByTanggal(tanggalMulai, tanggalSelesai); GridListControlHelper.Refresh <Kasbon>(this.gridList, _listOfKasbon); } ResetButton(); btnTambahPembayaran.Enabled = _listOfKasbon.Count > 0; GridListHandleSelectionChanged(this.gridListHistoriPembayaran); }
private void LoadData(bool isLunas) { using (new StCursor(Cursors.WaitCursor, new TimeSpan(0, 0, 0, 0))) { _listOfKasbon = _bll.GetByStatus(isLunas); GridListControlHelper.Refresh <Kasbon>(this.gridList, _listOfKasbon); } ResetButton(); btnTambahPembayaran.Enabled = _listOfKasbon.Count > 0; GridListHandleSelectionChanged(this.gridListHistoriPembayaran); }
private void InitGridList() { var gridListProperties = new List<GridListControlProperties>(); gridListProperties.Add(new GridListControlProperties { Header = "No", Width = 30 }); gridListProperties.Add(new GridListControlProperties { Header = "Nama", Width = 400 }); gridListProperties.Add(new GridListControlProperties { Header = "Alamat", Width = 700 }); gridListProperties.Add(new GridListControlProperties { Header = "Telepon" }); GridListControlHelper.InitializeGridListControl<Dropshipper>(this.gridList, _listOfDropshipper, gridListProperties); if (_listOfDropshipper.Count > 0) this.gridList.SetSelected(0, true); this.gridList.Grid.QueryCellInfo += delegate(object sender, GridQueryCellInfoEventArgs e) { if (_listOfDropshipper.Count > 0) { if (e.RowIndex > 0) { var rowIndex = e.RowIndex - 1; if (rowIndex < _listOfDropshipper.Count) { var dropshipper = _listOfDropshipper[rowIndex]; switch (e.ColIndex) { case 2: e.Style.CellValue = dropshipper.nama_dropshipper; break; case 3: e.Style.CellValue = dropshipper.alamat; break; case 4: e.Style.CellValue = dropshipper.telepon; break; default: break; } // we handled it, let the grid know e.Handled = true; } } } }; }
public void Ok(object sender, bool isNewData, object data) { var golongan = (Golongan)data; if (isNewData) { GridListControlHelper.AddObject <Golongan>(this.gridList, _listOfGolongan, golongan); ResetButton(); } else { GridListControlHelper.UpdateObject <Golongan>(this.gridList, _listOfGolongan, golongan); } }
public void Ok(object sender, bool isNewData, object data) { var penyesuaianStok = (PenyesuaianStok)data; if (isNewData) { GridListControlHelper.AddObject <PenyesuaianStok>(this.gridList, _listOfPenyesuaianStok, penyesuaianStok); ResetButton(); } else { GridListControlHelper.UpdateObject <PenyesuaianStok>(this.gridList, _listOfPenyesuaianStok, penyesuaianStok); } }
public void Ok(object sender, bool isNewData, object data) { var role = (Role)data; if (isNewData) { GridListControlHelper.AddObject <Role>(this.gridList, _listOfRole, role); ResetButton(); } else { GridListControlHelper.UpdateObject <Role>(this.gridList, _listOfRole, role); } }
public void Ok(object sender, bool isNewData, object data) { var karyawan = (Karyawan)data; if (isNewData) { GridListControlHelper.AddObject <Karyawan>(this.gridList, _listOfKaryawan, karyawan); ResetButton(); } else { GridListControlHelper.UpdateObject <Karyawan>(this.gridList, _listOfKaryawan, karyawan); } }
public void Ok(object sender, bool isNewData, object data) { var jual = (JualProduk)data; if (isNewData) { GridListControlHelper.AddObject <JualProduk>(this.gridList, _listOfJual, jual); ResetButton(); } else { GridListControlHelper.UpdateObject <JualProduk>(this.gridList, _listOfJual, jual); } }
public void Ok(object sender, bool isNewData, object data) { var supplier = (Supplier)data; if (isNewData) { GridListControlHelper.AddObject <Supplier>(this.gridList, _listOfSupplier, supplier); ResetButton(); } else { GridListControlHelper.UpdateObject <Supplier>(this.gridList, _listOfSupplier, supplier); } }
public void Ok(object sender, bool isNewData, object data) { var customer = (Customer)data; if (isNewData) { GridListControlHelper.AddObject <Customer>(this.gridList, _listOfCustomer, customer); ResetButton(); } else { GridListControlHelper.UpdateObject <Customer>(this.gridList, _listOfCustomer, customer); } }
public void Ok(object sender, bool isNewData, object data) { var pembayaran = (PembayaranPiutangProduk)data; if (isNewData) { GridListControlHelper.AddObject <PembayaranPiutangProduk>(this.gridList, _listOfPembayaranPiutang, pembayaran); ResetButton(); } else { GridListControlHelper.UpdateObject <PembayaranPiutangProduk>(this.gridList, _listOfPembayaranPiutang, pembayaran); } }