예제 #1
0
        private void salesinvoice_Load(object sender, EventArgs e)
        {
            butRemoveItem.Visible = true;
            butAdditem.Visible    = true;
            dtpdate.Value         = DateTime.Now;
            txtCustcode.Text      = "C";
            txtitemcode.Text      = "I";
            panel2.Visible        = false;
            Purchase.PurchaseDetails purChaseDetailObj = new Purchase.PurchaseDetails();
            vendorDetails = purChaseDetailObj.GetVendorDetaisInDataTable();
            ItemDetails   = purChaseDetailObj.GetItemPriceAndNameDetaisInDataTable();
            setAutoCompleteMode(txtproductname, "ItemName", ItemDetails);
            setAddToCraftTable();
            string    selectquery = "select  invoiceid from salesinvoice";
            DataTable dt3         = d.getDetailByQuery(selectquery);
            string    id          = "";

            foreach (DataRow dr in dt3.Rows)
            {
                id = dr[0].ToString();
            }
            if (id == "")
            {
                id           = "1";
                txtSrNo.Text = id;
            }
            else
            {
                int t  = Convert.ToInt32(id);
                int t1 = t + 1;
                txtSrNo.Text = t1.ToString();
            }
        }
예제 #2
0
        private void salesdelivary_Load(object sender, EventArgs e)
        {
            txtItemCode.Text     = "I";
            dtpDate.Value        = DateTime.Now;
            txtcustomercode.Text = "C";
            panel2.Visible       = false;
            Purchase.PurchaseDetails purChaseDetailObj = new Purchase.PurchaseDetails();
            vendorDetails = purChaseDetailObj.GetVendorDetaisInDataTable();
            ItemDetails   = purChaseDetailObj.GetItemPriceAndNameDetaisInDataTable();
            setAutoCompleteMode(txtProductName, "ItemName", ItemDetails);
            setAddToCraftTable();
            string    selectquery = "select  Delivaryid from salesOrderDelivery ";
            DataTable dt3         = d.getDetailByQuery(selectquery);
            string    id          = "";

            foreach (DataRow dr in dt3.Rows)
            {
                id = dr[0].ToString();
            }
            if (id == "")
            {
                id           = "1";
                txtSrNo.Text = id;
            }
            else
            {
                int t  = Convert.ToInt32(id);
                int t1 = t + 1;
                txtSrNo.Text = t1.ToString();
            }
        }
예제 #3
0
        private void Form7_Load(object sender, EventArgs e)
        {
            txtdate.Value = DateTime.Now;
            string    stlect = "select Deliveryid from CustomerOrderDelivery";
            DataTable dt     = dbMainClass.getDetailByQuery(stlect);
            string    id     = "";

            foreach (DataRow dr in dt.Rows)
            {
                id = dr[0].ToString();
            }
            //txtSrNo.Text = id;
            if (id == "")
            {
                id           = "1";
                txtSrNo.Text = id;
            }
            else
            {
                int txt  = Convert.ToInt32(id);
                int txt1 = txt + 1;
                txtSrNo.Text = txt1.ToString();
            }
            panel2.Visible = false;

            Purchase.PurchaseDetails purChaseDetailObj = new Purchase.PurchaseDetails();
            vendorDetails = purChaseDetailObj.GetVendorDetaisInDataTable();
            ItemDetails   = purChaseDetailObj.GetItemPriceAndNameDetaisInDataTable();
            setAutoCompleteMode(txtProductName, "ItemName", ItemDetails);
            setAddToCraftTable();
        }
예제 #4
0
        private void PurchaseOrder_Load(object sender, EventArgs e)
        {
            dtpDate.Value  = DateTime.Now;
            panel2.Visible = false;
            SqlConnection con    = dbMainClass.openConnection();
            string        stlect = "select  Orderid from VendorOrderDetails";
            DataTable     dt     = dbMainClass.getDetailByQuery(stlect);
            string        id     = "";

            foreach (DataRow dr in dt.Rows)
            {
                id = dr[0].ToString();
            }
            //txtSrNo.Text = id;
            if (id == "")
            {
                //int txt = Convert.ToInt32(id);
                //int txt1 = txt + 1;
                id           = "1";
                txtSrNo.Text = id;
            }
            else
            {
                int txt  = Convert.ToInt32(id);
                int txt1 = txt + 1;
                txtSrNo.Text = txt1.ToString();
            }

            Purchase.PurchaseDetails purChaseDetailObj = new Purchase.PurchaseDetails();
            vendorDetails = purChaseDetailObj.GetVendorDetaisInDataTable();
            ItemDetails   = purChaseDetailObj.GetItemPriceAndNameDetaisInDataTable();
            setAutoCompleteMode(txtProductName, "ItemName", ItemDetails);
            setAddToCraftTable();
            //setAutoCompleteMode(txtVendorName, "Name", vendorDetails);
        }
예제 #5
0
        private void Form9_Load(object sender, EventArgs e)
        {
            button1.Visible = false;
            Purchase.PurchaseDetails purChaseDetailObj = new Purchase.PurchaseDetails();
            vendorDetails  = purChaseDetailObj.GetVendorDetaisInDataTable();
            panel2.Visible = false;
            txtRefNo.Text  = orderid9;
            string    select  = "select Orderid from CustomerOrderInvoice where InvoiceId='" + orderid9 + "'";
            DataTable dt      = dbMainClass.getDetailByQuery(select);
            string    orderid = "";

            foreach (DataRow dr in dt.Rows)
            {
                orderid = dr[0].ToString();
            }
            string    select2  = "select venderId from VendorOrderDetails where Orderid='" + orderid + "'";
            DataTable dt2      = dbMainClass.getDetailByQuery(select2);
            string    vendorid = "";

            foreach (DataRow dr2 in dt2.Rows)
            {
                vendorid = dr2[0].ToString();
            }
            string    select1 = "select venderId,vName,vCompName,vAddress,vPhone,vMobile,vFax from VendorDetails where venderId='" + vendorid + "'";
            DataTable dt1     = dbMainClass.getDetailByQuery(select1);

            foreach (DataRow dr1 in dt1.Rows)
            {
                txtvendorId.Text    = dr1[0].ToString();
                txtVendorName.Text  = dr1[1].ToString();
                txtCompanyName.Text = dr1[2].ToString();
                txtAddress.Text     = dr1[3].ToString();
                txtPhone.Text       = dr1[4].ToString();
                txtMobile.Text      = dr1[5].ToString();
                txtFax.Text         = dr1[6].ToString();
            }
            string    selectqurry  = "select vod.ItemId,ide.ItemName,vod.Price,vod.Quantity,vod.TotalPrice from VendorOrderDesc vod join ItemDetails ide on Vod.ItemId=ide.ItemId where vod.Orderid='" + orderid + "'";
            DataTable dt3          = dbMainClass.getDetailByQuery(selectqurry);
            string    selectqurry1 = "select TotalPrice from VendorOrderDetails where Orderid='" + orderid + "'";
            DataTable dt4          = dbMainClass.getDetailByQuery(selectqurry1);

            foreach (DataRow dr3 in dt4.Rows)
            {
                txttotalAmount.Text = dr3[0].ToString();
            }
            dataGridView1.DataSource = dt3;
            string    selectqurry5 = "select PaymentId from VendorPayment";
            DataTable dt5          = dbMainClass.getDetailByQuery(selectqurry5);
            string    id           = "";

            foreach (DataRow dr4 in dt5.Rows)
            {
                id = dr4[0].ToString();
            }
            if (id == "")
            {
                id           = "1";
                txtSrNo.Text = id;
            }
            else
            {
                int txt  = Convert.ToInt32(id);
                int txt1 = txt + 1;
                txtSrNo.Text = txt1.ToString();
            }
        }
예제 #6
0
        private void Form5_Load(object sender, EventArgs e)
        {
            button1.Visible = false;
            Purchase.PurchaseDetails purchasedetailobj = new Purchase.PurchaseDetails();
            customerdetails    = purchasedetailobj.GetcustomerdetailsInDataTable();
            panel2.Visible     = false;
            txtcustomerid.Text = "C";
            string s = invoice;

            txtRefNo.Text  = s;
            panel2.Visible = false;
            string    select = " select Orderid from salesinvoice where invoiceid='" + s + "'";
            DataTable dt     = d.getDetailByQuery(select);
            string    invo   = "";

            foreach (DataRow dr in dt.Rows)
            {
                invo = dr[0].ToString();
            }
            string    select1 = "select Custid from orderdetails where Orderid='" + invo + "'";
            DataTable dt1     = d.getDetailByQuery(select1);
            string    ordorid = "";

            foreach (DataRow dr in dt1.Rows)
            {
                ordorid = dr[0].ToString();
            }
            string    select2 = " Select Custid, CustName,CustCompName ,CustAddress ,CustPhone ,CustMobile ,CustFax   from CustomerDetails where Custid='" + ordorid + "'";
            DataTable dt2     = d.getDetailByQuery(select2);

            foreach (DataRow dr in dt2.Rows)
            {
                txtcustomerid.Text      = dr[0].ToString();
                txtcustname.Text        = dr[1].ToString();
                txtcustcompnayname.Text = dr[2].ToString();
                txtaddress.Text         = dr[3].ToString();
                txtphone.Text           = dr[4].ToString();
                txtmobile.Text          = dr[5].ToString();
                txtfax.Text             = dr[6].ToString();
            }
            string    select3     = "select vod.ItemId,ide.ItemName,vod.Price,vod.Quantity,vod.totalammount from customerorderdescriptions vod join ItemDetails ide on Vod.ItemId=ide.ItemId where vod.Orderid='" + invo + "'";
            DataTable dt4         = d.getDetailByQuery(select3);
            string    selectquery = "select totalammount from orderdetails where orderid='" + invo + "'";
            DataTable dt5         = d.getDetailByQuery(selectquery);

            foreach (DataRow dr in dt5.Rows)
            {
                txttotalammount.Text = dr[0].ToString();
            }
            dataGridView1.DataSource = dt4;

            string    selectquery1 = "select id from payment";
            DataTable dt3          = d.getDetailByQuery(selectquery1);
            string    id           = "";

            foreach (DataRow dr in dt3.Rows)
            {
                id = dr[0].ToString();
            }
            if (id == "")
            {
                id           = "1";
                txtSrNo.Text = id;
            }
            else
            {
                int t  = Convert.ToInt32(id);
                int t1 = t + 1;
                txtSrNo.Text = t1.ToString();
            }
            //txtcustomerid.Text = "C";

            //dtpdate.Value = DateTime.Now;
            //Purchase.PurchaseDetails purchasedetailobj = new Purchase.PurchaseDetails();
            //customerdetails = purchasedetailobj.GetcustomerdetailsInDataTable();
            //panel2.Visible = false;
        }