예제 #1
0
        public DataTable GetPanTin()
        {
            StringBuilder sbQry = new StringBuilder();
            clsDB         oDB   = new clsDB();

            try
            {
                oDB.Connect();
                sbQry.Append("Select Top(1) TinNo,PanNo From mPanNo");
                return(oDB.GetDataTable(sbQry.ToString()));
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                sbQry = null;
                oDB.DisConnect();
                oDB = null;
            }
        }
예제 #2
0
        public DataTable GetAddress()
        {
            StringBuilder sbQry = new StringBuilder();
            clsDB         oDB   = new clsDB();

            try
            {
                oDB.Connect();
                sbQry.Append("Select Id,Address1,Address2,Address3,Address4 From mAddress Order by Id");
                return(oDB.GetDataTable(sbQry.ToString()));
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                sbQry = null;
                oDB.DisConnect();
                oDB = null;
            }
        }
예제 #3
0
        public DataTable GetHeader()
        {
            StringBuilder sbQry = new StringBuilder();
            clsDB         oDB   = new clsDB();

            try
            {
                oDB.Connect();
                sbQry.Append("Select Id,Header1,Header2,Header3,Header4 From mHeader Order by Id");
                return(oDB.GetDataTable(sbQry.ToString()));
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                sbQry = null;
                oDB.DisConnect();
                oDB = null;
            }
        }
예제 #4
0
        public DataTable GetItem()
        {
            StringBuilder sbQry = new StringBuilder();
            clsDB         oDB   = new clsDB();

            try
            {
                oDB.Connect();
                sbQry.Append("Select ItemDesc From Item Order by ItemDesc");
                return(oDB.GetDataTable(sbQry.ToString()));
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                sbQry = null;
                oDB.DisConnect();
                oDB = null;
            }
        }
        private void btnGet_Click(object sender, RoutedEventArgs e)
        {
            StringBuilder sbQry = new StringBuilder();
            clsDB         oDB   = new clsDB();

            try
            {
                oDB.Connect();
                sbQry.AppendLine("Select * From Invoice Where InvoiceDate >= '" + Convert.ToDateTime(FromDate.Text).ToString("dd-MMM-yyyy") + "' And InvoiceDate <= '" + Convert.ToDateTime(ToDate.Text).ToString("dd-MMM-yyyy") + "'");
                if (cmbFilter.SelectedIndex > 0)
                {
                    sbQry.AppendLine(" And " + cmbFilter.SelectedItem.ToString() + " Like '%" + txtFilterValue.Text.Trim() + "%'");
                }
                dg.ItemsSource       = oDB.GetDataTable(sbQry.ToString()).DefaultView;
                btnItemCount.Content = dg.Items.Count;
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }
            finally
            {
                sbQry = null;
                oDB.DisConnect();
                oDB = null;
            }
        }