Ejemplo n.º 1
0
        //Crystal View DataSourch
        public DataTable CristalReportDataSourch(Telerik.Windows.Controls.RadGridView radgridview, DataTable tempDataTable, Variables.OperationTrypes oprationType)
        {
            string                txtline          = string.Empty;
            NecessaryFunction     necessaryElement = new NecessaryFunction();
            GridViewExportOptions exportOption     = new GridViewExportOptions();

            exportOption.Format = ExportFormat.Text;
            string fileNameWithPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "DATA_EXPORT.txt");

            necessaryElement.CreateTextFile(fileNameWithPath);
            FileStream fileStream = new FileStream(fileNameWithPath, FileMode.OpenOrCreate, FileAccess.Write);

            radgridview.Export((Stream)fileStream, exportOption);
            fileStream.Close();
            fileStream.Dispose();
            StreamReader txtReader = new StreamReader(fileNameWithPath);

            while ((txtline = txtReader.ReadLine()) != null)
            {
                char[]   delimiterChars = { ' ', '"', '\t' };
                String[] columnData     = txtline.Split(delimiterChars, StringSplitOptions.RemoveEmptyEntries);
                if (oprationType.Equals(Variables.OperationTrypes.Sales))
                {
                    tempDataTable.Rows.Add(columnData[0].Trim(), columnData[1].Trim(), columnData[2].Trim(), columnData[3].Trim());
                }
                else if (oprationType.Equals(Variables.OperationTrypes.InvPurDebCre))
                {
                    tempDataTable.Rows.Add(columnData[0].Trim(), columnData[3].Trim(), columnData[4].Trim(), columnData[5].Trim(), columnData[6].Trim(), columnData[7].Trim(), columnData[8].Trim(), columnData[9].Trim(), columnData[11].Trim(), columnData[10].Trim());
                }
            }
            txtReader.Close();
            txtReader.Dispose();
            necessaryElement.DeleteFile(fileNameWithPath);
            return(tempDataTable);
        }
Ejemplo n.º 2
0
 //Ribbon Home & TransPort --> Product Return
 private void RinnonProductReturn(object sender, System.Windows.RoutedEventArgs e)
 {
     this.HideAllPanel();
     this.ReturnProductSalesItemClear();
     new ComboBoxDataLoader().AccTypeUserNameLoader(this.ReturnProductSalesComboBoxName, Variables.ACCOUNT_TYPE[1]);
     this.ReturnProductSalesProductInfo.CompanyNameLoader();
     this.ReturnProductSalesHeader.Text = Variables.OTHERS_VARIALES[0];
     this.ReturnProductSalesRadioButtonCreditOrDebit.Header = Variables.ACCOUNT_TYPE[0];
     operationType = Variables.OperationTrypes.PurchaseReturn;
     this.PanelReturnProductSales.Visibility = Visibility.Visible;
 }
Ejemplo n.º 3
0
 //Ribbon-->View-->Seals Return
 private void RibbonSelasReturnView(object sender, System.Windows.RoutedEventArgs e)
 {
     this.HideAllPanel();
     this.PurchaseSalesViewUIDisable();
     this.PurchaseSalesView();
     this.PurchaseSalesViewLabelHeader.Text = Variables.OTHERS_VARIALES[1];
     this.PurchaseSalesViewProductInfo.CompanyNameLoader();
     operationType = Variables.OperationTrypes.PurchaseReturn;
     this.PanelPurchaseSalesView.Visibility = Visibility.Visible;
 }
Ejemplo n.º 4
0
 //Ribbon View --> Debtors Payment History
 private void RibbonDebtorsPaymentHistory(object sender, System.Windows.RoutedEventArgs e)
 {
     HideAllPanel();
     this.DebtorsCredtorsViewUIDisable();
     DebtorsCreditorsViewItemClear();
     this.DebtorsCreditorsViewLabelHader.Text = Variables.ACCOUNT_TYPE[1];
     new ComboBoxDataLoader().AccTypeUserNameLoader(this.DebtorsCreditorsViewComboBoxName, Variables.ACCOUNT_TYPE[1]);
     operationType = Variables.OperationTrypes.Debtors;
     this.PanelDebtorsCreditorsView.Visibility = Visibility.Visible;
 }
Ejemplo n.º 5
0
 // Ribbon Home & Transport --> Debtors Payment
 private void RibbonDebtorsPayment(object sender, System.Windows.RoutedEventArgs e)
 {
     this.HideAllPanel();
     this.DebtorsCredtorsPaymentItemClear();
     new ComboBoxDataLoader().AccTypeUserNameLoader(this.DebtorsCredtorsPaymentComboBoxName, Variables.ACCOUNT_TYPE[1]);
     this.DebtorCredtorsPaymentLabelHeader.Text = Variables.ACCOUNT_TYPE[1];
     operationType = Variables.OperationTrypes.Debtors;
     this.PanelDebtorsPayment.Visibility = Visibility.Visible;
 }
Ejemplo n.º 6
0
 //Ribbon Transport -->Cash Receive
 private void RibbonCashReceive(object sender, System.Windows.RoutedEventArgs e)
 {
     this.HideAllPanel();
     this.CashRecivePaymentItemClear();
     operationType = Variables.OperationTrypes.CashReceive;
     this.CashReceivePaymentLabelHeader.Text = Variables.OperationTrypes.CashReceive.ToString();
     this.PanelCashReceivePayment.Visibility = Visibility.Visible;
 }