示例#1
0
        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            gridView1.RefreshData();
            DataTable source = gridControl1.DataSource as DataTable;
            //source = dc.gridvalidation(source);
            DataTable dt = new DataTable();

            dt.Clear();
            dt.Columns.Add("Pinvoiceno");
            dt.Columns.Add("date");
            dt.Columns.Add("billto");
            dt.Columns.Add("billaddress");
            dt.Columns.Add("shipto");
            dt.Columns.Add("shipaddress");
            dt.Columns.Add("note");
            dt.Columns.Add("subtotal");
            dt.Columns.Add("tax");
            dt.Columns.Add("shipping");
            dt.Columns.Add("grandtotal");
            dt.Columns.Add("status");
            dt.Rows.Add(new object[] { txtinvoice.Text, dtpdate.Text, txtbillto.Text, txtbilladdress.Text, txtshipto.Text, txtshipaddress.Text, txtnotes.Text, txtsubtotal.Text, txttax.Text, txtship.Text, txtgrandtotal.Text, "Not Invoice" });
            Test.Sale.Database.PerformanceInvoiceData performance = new Sale.Database.PerformanceInvoiceData(source, dt);
            performance.FnConn();
            performance.fnTransactionData();
            string res = performance.FnTrans();

            MessageBox.Show(res, "Alert", MessageBoxButtons.OK, MessageBoxIcon.Information);
            barButtonItem1.Enabled = false;
            barButtonItem4.Enabled = true;
        }
示例#2
0
 private void Proforma_Invoice_Load(object sender, EventArgs e)
 {
     if (proinvoiceno != null)
     {
         txtinvoice.Text = proinvoiceno;
         Sale.Database.PerformanceInvoiceData p2 = new Sale.Database.PerformanceInvoiceData();
         p2.FnConn();
         DataSet   ds      = p2.FillDataSet("searchgrid", proinvoiceno, "spperformanceInvoice");
         DataTable inv     = ds.Tables[0];
         DataTable invgrid = ds.Tables[1];
         p2.FnTrans();
         if (inv.Rows.Count > 0)
         {
             Commen_Form.Functions.DateConverter dc = new Commen_Form.Functions.DateConverter();
             dtpdate.EditValue      = dc.dateconverter(inv.Rows[0]["date"] + "");
             txtbillto.Text         = inv.Rows[0]["billto"] + "";
             txtbilladdress.Text    = inv.Rows[0]["billaddress"] + "";
             txtshipto.Text         = inv.Rows[0]["shipto"] + "";
             txtshipaddress.Text    = inv.Rows[0]["shipaddress"] + "";
             txtnotes.Text          = inv.Rows[0]["note"] + "";
             txtsubtotal.Text       = inv.Rows[0]["sutotal"] + "";
             txttax.Text            = inv.Rows[0]["tax"] + "";
             txtship.Text           = inv.Rows[0]["shipping"] + "";
             txtgrandtotal.Text     = inv.Rows[0]["grandtotal"] + "";
             barButtonItem1.Enabled = false;
         }
         if (invgrid.Rows.Count > 0)
         {
             gridControl1.DataSource = invgrid;
         }
     }
     else
     {
         Sale.Database.PerformanceInvoiceData pi = new Sale.Database.PerformanceInvoiceData();
         pi.FnConn();
         DataTable dt = pi.FillData("M", "", "spperformanceInvoice");
         pi.FnTrans();
         if (dt.Rows.Count > 0)
         {
             int    number = Convert.ToInt32(dt.Rows[0][0].ToString()) + 1;
             string num    = number + "";
             num             = "PRI/" + num.PadLeft(5, '0');
             txtinvoice.Text = num;
         }
         dtpdate.EditValue = DateTime.Now;
         DataTable dt3 = new DataTable();
         dt3.Columns.Add("slno", Type.GetType("System.Int32"));
         dt3.Columns.Add("pinvoice_no", Type.GetType("System.String"));
         dt3.Columns.Add("itemCode", Type.GetType("System.String"));
         dt3.Columns.Add("description", Type.GetType("System.String"));
         dt3.Columns.Add("quantity", Type.GetType("System.Double"));
         dt3.Columns.Add("unitPrice", Type.GetType("System.Double"));
         dt3.Columns.Add("amount", Type.GetType("System.Double"));
         dt3.Columns.Add("status", Type.GetType("System.String"));
         gridControl1.DataSource = dt3;
     }
 }
        void loaddata()
        {
            Sale.Database.PerformanceInvoiceData pi = new Sale.Database.PerformanceInvoiceData();
            pi.FnConn();
            DataTable dt = pi.FillData("S", "", "spperformanceInvoice");

            if (dt.Rows.Count > 0)
            {
                gridControl1.DataSource = dt;
            }
        }