private void New_Warranty_Claim_Load(object sender, EventArgs e)
        {
            if (claimeNo != null)
            {
                warrenty.FnConn();
                barButtonItem1.Caption = "Update";
                DataTable dt = warrenty.FillData("search", "spWarrenty", claimeNo);
                if (dt.Rows.Count > 0)
                {
                    txtclaimeno.Text = dt.Rows[0]["claimNo"] + "";
                    Commen_Form.Functions.DateConverter dc = new Commen_Form.Functions.DateConverter();


                    dtpdate.Text        = dc.dateconverter(dt.Rows[0]["date"] + "");
                    txtcontactName.Text = dt.Rows[0]["contactName"] + "";
                    txtContactNo.Text   = dt.Rows[0]["contactNumber"] + "";
                    txtmailId.Text      = dt.Rows[0]["mailid"] + "";


                    dtpurchaseDate.Text       = dc.dateconverter(dt.Rows[0]["purchaseDate"] + "");
                    txtItemNamae.Text         = dt.Rows[0]["itemName"] + "";
                    txtmodelName.Text         = dt.Rows[0]["modelNo"] + "";
                    txtSerialNumber.Text      = dt.Rows[0]["serialNo"] + "";
                    txtcomplaintDeatails.Text = dt.Rows[0]["complaintDetails"] + "";
                    cmbstatus.Text            = dt.Rows[0]["status"] + "";
                    warrenty.FnTrans();
                }
            }
            else
            {
                loadnewForm();
            }
        }
 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;
     }
 }
Beispiel #3
0
        private void New_RFQ_Load(object sender, EventArgs e)
        {
            Test.Purchase.database.Rfq pr = new Purchase.database.Rfq();
            pr.FnConn();

            DataTable dt1 = pr.FillData("M", "");


            DataTable dt = new DataTable();

            if (dt1.Rows.Count > 0)
            {
                int    number    = Convert.ToInt32(dt1.Rows[0]["number"].ToString()) + 1;
                string invoiceno = number + "";
                txtRFQNO.Text = "RFQ-NO:" + invoiceno.PadLeft(5, '0');
            }



            dt.Columns.Add("slno", Type.GetType("System.Int32"));
            dt.Columns.Add("description", Type.GetType("System.String"));
            dt.Columns.Add("brand", Type.GetType("System.String"));
            dt.Columns.Add("quantity", Type.GetType("System.Int32"));
            DataRow dr = dt.NewRow();

            dt.Rows.Add(dr);
            gridControl1.DataSource = dt;
            cmbVendor1.Properties.Items.Clear();
            cmbVendor2.Properties.Items.Clear();
            cmbVendor3.Properties.Items.Clear();

            DataTable dtc1 = pr.FillData("SC", "");

            foreach (DataRow dr1 in dtc1.Rows)
            {
                cmbVendor1.Properties.Items.Add(dr1["name"] + "");
                cmbVendor2.Properties.Items.Add(dr1["name"] + "");
                cmbVendor3.Properties.Items.Add(dr1["name"] + "");
            }

            String res = pr.FnTrans();

            Test.Purchase.database.PurchaseRequest pr1 = new Purchase.database.PurchaseRequest();
            pr1.FnConn();
            DataTable dtd = pr1.FillData("updatedata", no);
            DataTable dtg = pr1.FillData("updategrd", no);

            gridControl1.DataSource = dtg;
            txtPO.Text = dtd.Rows[0]["prNo"].ToString();
            Test.Commen_Form.Functions.DateConverter c = new Commen_Form.Functions.DateConverter();
            dateRFQdate.EditValue = c.dateconverter(dtd.Rows[0]["date"] + "");
            txtLocation.Text      = dtd.Rows[0]["location"] + "";
        }
Beispiel #4
0
 private void Sales_Return_Load(object sender, EventArgs e)
 {
     Commen_Form.Functions.DateConverter dc = new Commen_Form.Functions.DateConverter();
     if (Invoiceno != "")
     {
         txtinvoiceno.Text = Invoiceno;
         Sale.Database.SalesData salesData = new Sale.Database.SalesData();
         salesData.FnConn();
         DataSet   ds      = salesData.FillDataSet("select", Invoiceno, "spsales");
         DataTable inv     = ds.Tables[0];
         DataTable invgrid = ds.Tables[1];
         DataTable max     = salesData.FillData("M", "", "spsalesReturn");
         if (max.Rows.Count > 0)
         {
             returnno = (Convert.ToInt32(max.Rows[0][0] + "") + 1) + "";
         }
         if (invgrid.Rows.Count > 0)
         {
             //invgrid.Columns.Add("retqty");
             for (int i = 0; i < invgrid.Rows.Count; i++)
             {
                 invgrid.Rows[i]["returnNO"] = returnno;
                 invgrid.Rows[i]["retqty"]   = "0";
             }
             gridControl1.DataSource = invgrid;
         }
         if (inv.Rows.Count > 0)
         {
             if (inv.Rows[0]["type"] + "" == "Credit")
             {
                 toggleSwitch1.IsOn = true;
                 type = "Credit";
             }
             else
             {
                 toggleSwitch1.IsOn = false;
                 type = "Cash";
             }
             CustomerId           = inv.Rows[0]["customerid"] + "";
             txtcustomername.Text = inv.Rows[0]["customerName"] + "";
             txtaddress.Text      = inv.Rows[0]["address"] + "";
             txtphone.Text        = inv.Rows[0]["phone"] + "";
             dtpdate.Text         = dc.dateconverter(inv.Rows[0]["date"] + "");
             txtnetamount.Text    = inv.Rows[0]["netTotal"] + "";
             payamount.Text       = inv.Rows[0]["payAmount"] + "";
             txtsalesperson.Text  = inv.Rows[0]["salesPerson"] + "";
         }
     }
 }
Beispiel #5
0
        private void Purchase_Requst_Load(object sender, EventArgs e)
        {
            Test.Purchase.database.PurchaseRequest pr = new Purchase.database.PurchaseRequest();
            pr.FnConn();

            if (flag == true)
            {
                btnSave.Caption = "Update";
                DataTable dt  = pr.FillData("updatedata", no);
                DataTable dt1 = pr.FillData("updategrd", no);

                gridControl1.DataSource = dt1;
                txtLocation.Text        = dt.Rows[0]["location"] + "";
                txtPRNo.Text            = dt.Rows[0]["prNo"] + "";
                txtRequester.Text       = dt.Rows[0]["requester"] + "";
                Test.Commen_Form.Functions.DateConverter c = new Commen_Form.Functions.DateConverter();
                datePOdate.EditValue = c.dateconverter(dt.Rows[0]["date"] + "");
            }
            else
            {
                btnSave.Caption = "Save";
                DataTable dt1 = pr.FillData("M", "");
                String    res = pr.FnTrans();

                DataTable dt = new DataTable();

                if (dt1.Rows.Count > 0)
                {
                    number = Convert.ToInt32(dt1.Rows[0]["number"].ToString()) + 1;
                    string invoiceno = number + "";
                    txtPRNo.Text = "PR/" + invoiceno.PadLeft(5, '0');
                }

                dt.Columns.Add("slno", Type.GetType("System.Int32"));
                dt.Columns.Add("itemNo", Type.GetType("System.String"));
                dt.Columns.Add("description", Type.GetType("System.String"));
                dt.Columns.Add("brand", Type.GetType("System.String"));
                dt.Columns.Add("quantity", Type.GetType("System.Int32"));
                DataRow dr = dt.NewRow();
                dt.Rows.Add(dr);
                gridControl1.DataSource = dt;
                datePOdate.EditValue    = DateTime.Now;
            }
        }
Beispiel #6
0
        private void New_PO_Load(object sender, EventArgs e)
        {
            txtTotal.Text = "0.00";
            Test.Purchase.database.PurchaseOrder po = new Purchase.database.PurchaseOrder();
            po.FnConn();
            RepositoryItemComboBox riCombo = new RepositoryItemComboBox();
            DataTable dtc = po.FillData("loadUnit", "");

            foreach (DataRow row in dtc.Rows)
            {
                riCombo.Items.Add(row["um"]);
            }
            persistentRepository1.Items.Add(riCombo);
            gridControl1.ExternalRepository = persistentRepository1;


            DataTable dt1 = po.FillData("M", "");


            DataTable dt = new DataTable();

            datePOdate.EditValue = DateTime.Now;
            if (dt1.Rows.Count > 0)
            {
                int    number    = Convert.ToInt32(dt1.Rows[0]["number"].ToString()) + 1;
                string invoiceno = number + "";
                txtPO.Text = "PO-NO:" + invoiceno.PadLeft(5, '0');
            }

            DataTable dtv = po.FillData("SC", "");
            AutoCompleteStringCollection collection = new AutoCompleteStringCollection();

            if (dtv.Rows.Count > 0)
            {
                for (int i = 0; i < dtv.Rows.Count; i++)
                {
                    collection.Add(dtv.Rows[i]["name"].ToString());
                }
            }

            txtVendor.MaskBox.AutoCompleteMode         = AutoCompleteMode.SuggestAppend;
            txtVendor.MaskBox.AutoCompleteSource       = AutoCompleteSource.CustomSource;
            txtVendor.MaskBox.AutoCompleteCustomSource = collection;

            if (flag == true)
            {
                DataTable dtd = po.FillData("updatedata", no);
                DataTable dtg = po.FillData("updategrd", no);
                String    res = po.FnTrans();

                (gridControl1.MainView as GridView).Columns["um"].ColumnEdit = riCombo;
                dtg.Columns.Add("um", Type.GetType("System.String"));
                dtg.Columns.Add("unitprice", Type.GetType("System.Double"));
                dtg.Columns.Add("amount", Type.GetType("System.Double"));
                dtg.Columns.Add("taxpercent", Type.GetType("System.Double"));
                dtg.Columns.Add("taxamount", Type.GetType("System.Double"));
                dtg.Columns.Add("total", Type.GetType("System.Double"));
                gridControl1.DataSource = dtg;

                datePOdate.EditValue = DateTime.Now;
                txtPRNo.Text         = dtd.Rows[0]["purchaseOrderNo"] + "";
                txtRFQNo.Text        = dtd.Rows[0]["rfqNo"] + "";
                txtrequester.Text    = dtd.Rows[0]["requester"] + "";
                txtLocation.Text     = dtd.Rows[0]["location"] + "";

                Test.Commen_Form.Functions.DateConverter c = new Commen_Form.Functions.DateConverter();
                datePOdate.EditValue = c.dateconverter(dtd.Rows[0]["date"] + "");
            }
            else
            {
                dt.Columns.Add("slno", Type.GetType("System.Int32"));
                dt.Columns.Add("itemCode", Type.GetType("System.String"));
                dt.Columns.Add("description", Type.GetType("System.String"));
                dt.Columns.Add("brand", Type.GetType("System.String"));
                (gridControl1.MainView as GridView).Columns["um"].ColumnEdit = riCombo;
                dt.Columns.Add("quantity", Type.GetType("System.Double"));
                dt.Columns.Add("um", Type.GetType("System.String"));
                dt.Columns.Add("unitprice", Type.GetType("System.Double"));
                dt.Columns.Add("amount", Type.GetType("System.Double"));
                dt.Columns.Add("taxpercent", Type.GetType("System.Double"));
                dt.Columns.Add("taxamount", Type.GetType("System.Double"));
                dt.Columns.Add("total", Type.GetType("System.Double"));

                DataRow dr = dt.NewRow();
                dt.Rows.Add(dr);
                gridControl1.DataSource = dt;
            }
        }
Beispiel #7
0
        private void Delivery_Note_Load(object sender, EventArgs e)
        {
            salesDeliveryData.FnConn();
            DataTable dt = salesDeliveryData.FillData("S", "", "spCustomer");
            AutoCompleteStringCollection collection = new AutoCompleteStringCollection();

            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    collection.Add(dt.Rows[i]["name"].ToString());
                }
            }

            txtCustomerName.MaskBox.AutoCompleteMode         = AutoCompleteMode.SuggestAppend;
            txtCustomerName.MaskBox.AutoCompleteSource       = AutoCompleteSource.CustomSource;
            txtCustomerName.MaskBox.AutoCompleteCustomSource = collection;

            if (deliveryNoteNo != null)
            {
                barButtonItem1.Enabled = false;
                barButtonItem5.Enabled = true;
                DataSet   ds  = salesDeliveryData.FillDataSet("searchgrid", deliveryNoteNo, "spsalesDelivery");
                DataTable tab = ds.Tables[0];
                salesDeliveryData.FnTrans();
                if (tab.Rows.Count > 0)
                {
                    txtdeliveryNo.Text = tab.Rows[0]["deliveryNo"] + "";
                    Commen_Form.Functions.DateConverter dc = new Commen_Form.Functions.DateConverter();
                    dtpdate.EditValue    = dc.dateconverter(tab.Rows[0]["date"] + "");
                    txtsalesPerson.Text  = tab.Rows[0]["salesPerson"] + "";
                    txtCustomerName.Text = tab.Rows[0]["customerName"] + "";
                    txtaddress.Text      = tab.Rows[0]["address"] + "";
                    txtemail.Text        = tab.Rows[0]["contact"] + "";
                    DataTable gridData = ds.Tables[1];
                    gridControl1.DataSource = gridData;
                }
            }
            else
            {
                dtpdate.EditValue      = DateTime.Now;
                barButtonItem5.Enabled = false;
                DataTable dt1 = salesDeliveryData.FillData("M", "", "spsalesDelivery");
                if (dt1.Rows.Count > 0)
                {
                    int    slno = Convert.ToInt32(dt1.Rows[0][0].ToString()) + 1;
                    string deno = slno + "";

                    txtdeliveryNo.Text = "DLN/" + deno.PadLeft(5, '0');
                }
                DataTable dt3 = new DataTable();
                dt3.Columns.Add("slno", Type.GetType("System.Int32"));
                dt3.Columns.Add("deliveryNo", Type.GetType("System.String"));
                dt3.Columns.Add("barcode", Type.GetType("System.String"));
                dt3.Columns.Add("description", Type.GetType("System.String"));
                dt3.Columns.Add("quantity", Type.GetType("System.Double"));
                dt3.Columns.Add("status", Type.GetType("System.String"));
                gridControl1.DataSource = dt3;
                salesDeliveryData.FnTrans();
            }
        }
Beispiel #8
0
        public void LoadData()
        {
            if (ProdCode != null)
            {
                ProductData Prod = new ProductData();
                Prod.FnConn();
                DataTable dtProd = new DataTable();
                dtProd = Prod.GetRow(ProdCode);

                if (FormName == "Product")
                {
                    btnSave.Caption = "Update";
                    Commen_Form.Functions.DateConverter Conv = new Commen_Form.Functions.DateConverter();

                    if (dtProd.Rows.Count > 0)
                    {
                        txtProduct_code.Text  = dtProd.Rows[0]["productCode"] + "";
                        txtQRCode.Text        = dtProd.Rows[0]["qrCode"] + "";
                        txtItem_name.Text     = dtProd.Rows[0]["itemName"] + "";
                        cmbUnit.Text          = dtProd.Rows[0]["unitMeasure"] + "";
                        cmbBrand_name.Text    = dtProd.Rows[0]["brandName"] + "";
                        cmbItem_category.Text = dtProd.Rows[0]["category"] + "";
                        cmbTax_category.Text  = dtProd.Rows[0]["taxCategory"] + "";
                        cmbPurchase_Tax.Text  = dtProd.Rows[0]["taxOnPurchase"] + "";
                        cmbSales_tax.Text     = dtProd.Rows[0]["taxOnSale"] + "";
                        txtPurchase_rate.Text = dtProd.Rows[0]["purchaseRate"] + "";
                        txtOpening_stock.Text = dtProd.Rows[0]["openingStock"] + "";
                        txtReorder_qty.Text   = dtProd.Rows[0]["reorderQuantity"] + "";
                        txtMin_qty.Text       = dtProd.Rows[0]["minimumQuantity"] + "";
                        txtSales_rate1.Text   = dtProd.Rows[0]["salesRate1"] + "";
                        txtSales_rate2.Text   = dtProd.Rows[0]["salesRate2"] + "";
                        txtSales_rate3.Text   = dtProd.Rows[0]["salesRate3"] + "";
                        txtBatch_name.Text    = dtProd.Rows[0]["batchName"] + "";
                        dtMfg_date.Text       = Conv.dateconverter(dtProd.Rows[0]["mfgDate"] + "");
                        dtExp_date.Text       = Conv.dateconverter(dtProd.Rows[0]["expDate"] + "");
                        memWarranty.Text      = dtProd.Rows[0]["warrentyDetails"] + "";
                        cmbLocation.Text      = dtProd.Rows[0]["location"] + "";
                    }
                }
                else
                {
                    if (dtProd.Rows.Count > 0)
                    {
                        txtProduct_code.Text  = "ID-C:000000" + (Convert.ToInt16(Prod.GetMaxValue()) + 1);
                        txtQRCode.Text        = dtProd.Rows[0]["qrCode"] + "";
                        txtItem_name.Text     = dtProd.Rows[0]["itemName"] + "";
                        cmbUnit.Text          = dtProd.Rows[0]["unitMeasure"] + "";
                        cmbBrand_name.Text    = dtProd.Rows[0]["brandName"] + "";
                        cmbItem_category.Text = dtProd.Rows[0]["category"] + "";
                        txtPurchase_rate.Text = PurRate;
                        txtOpening_stock.Text = Qty;
                        txtReorder_qty.Text   = dtProd.Rows[0]["reorderQuantity"] + "";
                        txtMin_qty.Text       = dtProd.Rows[0]["minimumQuantity"] + "";
                        txtBatch_name.Text    = BatchID;

                        Pdt_No = dtProd.Rows[0]["productCode"] + "";
                    }
                }
                Prod.FnTrans();
            }
            else
            {
                btnDelete.Enabled = false;
            }
        }