コード例 #1
0
        void loadData()
        {
            Inventory.Database.MRRData MRR = new Inventory.Database.MRRData(null, null);
            // Purchase.database.PurchaseOrder PO = new Purchase.database.PurchaseOrder();
            try
            {
                MRR.FnConn();
                DataTable dt = MRR.FillData("S");
                if (dt.Rows.Count > 0)
                {
                    gridControl1.DataSource = dt;
                }

                DataTable dt1 = MRR.FillData("SPO");
                if (dt1.Rows.Count > 0)
                {
                    gridControl2.DataSource = dt1;
                }
                MRR.FnTrans();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
コード例 #2
0
        private void btnSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (txtItem_name.Text != "" && cmbItem_category.Text != "" && txtOpening_stock.Text != "")
            {
                NewProd.ProdCode        = txtProduct_code.Text;
                NewProd.QRCode          = txtQRCode.Text;
                NewProd.ItemName        = txtItem_name.Text;
                NewProd.UnitMeasure     = cmbUnit.Text;
                NewProd.BrandName       = cmbBrand_name.Text;
                NewProd.Category        = cmbItem_category.Text;
                NewProd.TaxCategory     = cmbTax_category.Text;
                NewProd.PurchaseTax     = cmbPurchase_Tax.Text;
                NewProd.SalesTax        = cmbSales_tax.Text;
                NewProd.PurchaseRate    = txtPurchase_rate.Text;
                NewProd.OpeningStock    = txtOpening_stock.Text;
                NewProd.ReoderQty       = txtReorder_qty.Text;
                NewProd.MinQty          = txtMin_qty.Text;
                NewProd.SalesRate1      = txtSales_rate1.Text;
                NewProd.SalesRate2      = txtSales_rate2.Text;
                NewProd.SalesRate3      = txtSales_rate3.Text;
                NewProd.BatchName       = txtBatch_name.Text;
                NewProd.MfgDate         = dtMfg_date.Text;
                NewProd.ExpDate         = dtExp_date.Text;
                NewProd.WarrantyDetails = memWarranty.Text;
                NewProd.Location        = cmbLocation.Text;

                if (btnSave.Caption == "Save")
                {
                    NewProd.FnConn();
                    NewProd.fnTransactionData("I");
                    NewProd.FnTrans();
                    if (FormName != "Product")
                    {
                        Inventory.Database.MRRData MRR = new Inventory.Database.MRRData(null, null);

                        MRR.FnConn();
                        MRR.UpdateMrrStatus(Mrr_No, Pdt_No);
                        MRR.FnTrans();
                    }
                    if (NewProd.Result == "Success")
                    {
                        MessageBox.Show("Product Created", "ALERT", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show("Product Creation failed", "ALERT", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    NewProd.FnConn();
                    NewProd.fnTransactionData("U");
                    NewProd.FnTrans();
                    if (NewProd.Result == "Success")
                    {
                        MessageBox.Show("Updated..", "ALERT", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                Clear();
            }
            else
            {
                MessageBox.Show("Please fill mandatory fields");
            }
        }