Exemplo n.º 1
0
        public void RefreshDataDO()
        {
            _fromDate = Convert.ToDateTime(rangeDateBox1.FromDate.Value);
            _toDate   = Convert.ToDateTime(rangeDateBox1.ToDate.Value);



            try
            {
                this.Cursor = Cursors.WaitCursor;
                dtDO        = new DataTable();
                using (Database db = new Database())
                {
                    db.Commands.Add(db.CreateCommand("usp_OrderPenjualan_LIST_FILTER_TglDO3"));
                    db.Commands[0].Parameters.Add(new Parameter("@fromDate", SqlDbType.DateTime, _fromDate));
                    db.Commands[0].Parameters.Add(new Parameter("@toDate", SqlDbType.DateTime, _toDate));
                    dtDO = db.Commands[0].ExecuteDataTable();
                }
                // -----------tampil data ke detail



                dtDO.DefaultView.Sort         = "TglDO, NoDOAndFlag";
                DGVHeaderPenjualan.DataSource = dtDO.DefaultView;


                if (DGVHeaderPenjualan.SelectedCells.Count > 0)
                {
                    RefreshDataDetailDO();
                    lblHeader.Text = "\"" + DGVHeaderPenjualan.SelectedCells[0].OwningRow.Cells["HeadTokoCust"].Value.ToString() + "\" "
                                     + DGVHeaderPenjualan.SelectedCells[0].OwningRow.Cells["HeadAlamatKirim"].Value.ToString();
                    DGVHeaderPenjualan.Focus();
                }
                else
                {
                    CmdAdd.DataSource       = null;
                    lblHeader.Text          = " ";
                    txtJumlahHarga2.Text    = "";
                    txtJumlahPotongan2.Text = "";
                    txtHargaNett2.Text      = "";
                    txtJumlahHPP2.Text      = "";
                }
            }
            catch (Exception ex)
            {
                Error.LogError(ex);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
Exemplo n.º 2
0
 private void cmdSearch_Click(object sender, EventArgs e)
 {
     RefreshDataDO();
     DGVHeaderPenjualan.Focus();
     selectedGrid = enumSelectedGrid.DOSelected;
 }