示例#1
0
        private void frmVendorDetails_Load(object sender, EventArgs e)
        {
            string               selectqurry = "select  vName as NAME, vCompName as COMPNAME,vAddress as ADDRESS,vCity as CITY,vState as STATE,vZip as ZIP,vCountry as COUNTRY,vEmail as EMAIL,vWebAddress as WEBADDRESS,vPhone as PHONE,vMobile as MOBILE,vFax as FAX,vDesc as DESCription,vPanNo as PanNo,vTinNo as TinNo from VendorDetails";
            DataTable            dt          = dbMainClass.getDetailByQuery(selectqurry);
            List <string>        ls          = new List <string>();
            DataColumnCollection d           = dt.Columns;

            for (int a = 0; a < d.Count; a++)
            {
                DataColumn dc = new DataColumn();
                string     b  = d[a].ToString();
                ls.Add(b);
            }
            comboBox1.DataSource = ls;
            panel1.Visible       = false;
            string Id = dbMainClass.getUniqueID("VENDOR");

            txtVenderCode.Text = Id;
            if (Id == "V0001")
            {
                btnVenderList.Enabled = false;
            }
            else
            {
                btnVenderList.Enabled = true;
            }
        }
示例#2
0
        private void ItemList_Load(object sender, EventArgs e)
        {
            string               selectqurry = "select itm.Itemid, itm.ItemName,itm.ItemCompName,itm.ItemDesc,itm.groupid,itm.Unitid,ipd.purChasePrice,ipd.SalesPrice,ipd.MrpPrice,ipd.Margin,iqd.OpeningQuantity,iqd.CurrentQuantity from ItemDetails itm join ItemPriceDetail ipd on itm.itemid=ipd.itemid join ItemQuantityDetail iqd on ipd.itemid=iqd.itemid";
            DataTable            dt          = dbMainClass.getDetailByQuery(selectqurry);
            List <string>        ls          = new List <string>();
            DataColumnCollection d           = dt.Columns;

            for (int a = 1; a < d.Count; a++)
            {
                string b = d[a].ToString();
                ls.Add(b);
            }
            comboItem.DataSource     = ls;
            dataGridView1.DataSource = dt;
        }
示例#3
0
        private void Customer_list_Load(object sender, EventArgs e)
        {
            string               selectQuery = "select cd.custid,cd.CustName,cd.CustCompName,cd.CustAddress,cd.CustCity,cd.CustState,cd.CustZip,cd.CustCountry,cd.CustEmail,cd.CustWebAddress,cd.CustPhone,cd.CustMobile,cd.CustFax,cd.CustDesc,cad.CustOpeningBalance,cad.CustCurrentBalance,cd.PanNo,cd.TanNo,cd.Others from CustomerDetails cd join CustomerAccountDetails cad on cd.CustId=cad.CustId ";
            DataTable            dt          = d.getDetailByQuery(selectQuery);
            List <string>        sd          = new List <string>();
            DataColumnCollection d1          = dt.Columns;

            for (int a = 1; a < d1.Count; a++)
            {
                DataColumn dc  = new DataColumn();
                string     val = d1[a].ToString();
                sd.Add(val);
            }
            comboBox1.DataSource     = sd;
            dataGridView1.DataSource = dt;
        }
示例#4
0
        private void PurchasSearch_Load(object sender, EventArgs e)
        {
            string               selectqurry = "select od.Orderid,od.venderId,itd.ItemName,vod.Quantity,vod.TotalPrice,od.OrderDate,cod.DeliveryDate,coi.InvoiceDate from VendorOrderDetails od join VendorOrderDesc vod on od.Orderid=vod.Orderid join CustomerOrderDelivery cod on cod.Orderid=vod.Orderid join CustomerOrderInvoice coi on coi.Orderid=vod.Orderid join ItemDetails itd on itd.ItemId=vod.ItemId";
            DataTable            dt          = dbMainClass.getDetailByQuery(selectqurry);
            List <string>        ls          = new List <string>();
            DataColumnCollection d           = dt.Columns;

            for (int a = 0; a < d.Count; a++)
            {
                DataColumn dc = new DataColumn();
                string     b  = d[a].ToString();
                ls.Add(b);
            }
            comboPurchasesearch.DataSource = ls;
            gridPurchaseSearch.DataSource  = dt;
        }
        private void VendorList_Load(object sender, EventArgs e)
        {
            string               selectqurry = "select vd.venderId,vd.vName as NAME,vd.vCompName as COMPNAME,vd.vAddress as ADDRESS,vd.vCity as CITY,vd.vState as STATE,vZip as ZIP,vd.vCountry as COUNTRY,vd.vEmail as EMAIL,vd.vWebAddress as WEBADDRESS,vd.vPhone as PHONE,vd.vMobile as MOBILE,vd.vFax as FAX,vd.vDesc as DESCription,Vad.vOpeningBalance as OpeningBalance,vad.vCurrentBalance as CurrentBalance,vd.vPanNo,vd.vTinNo  from VendorDetails vd join VendorAccountDetails Vad on vd.venderId=Vad.venderId";
            DataTable            dt          = dbMainClass.getDetailByQuery(selectqurry);
            List <string>        ls          = new List <string>();
            DataColumnCollection d           = dt.Columns;

            for (int a = 1; a < d.Count; a++)
            {
                DataColumn dc = new DataColumn();
                string     b  = d[a].ToString();
                ls.Add(b);
            }
            comboBox1.DataSource     = ls;
            dataGridView1.DataSource = dt;
        }
示例#6
0
        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            string    s           = comserchvalue.SelectedValue.ToString();
            string    val         = "Cust" + s;
            string    selectQuery = "select cd.custid,cd.CustName,cd.CustCompName,cd.CustAddress,cd.CustCity,cd.CustState,cd.CustZip,cd.CustCountry,cd.CustEmail,cd.CustWebAddress,cd.CustPhone,cd.CustMobile,cd.CustFax,cd.CustDesc,cd.panno,cd.tanno,cd.tanno,cad.CustOpeningBalance,cad.CustCurrentBalance from CustomerDetails cd join CustomerAccountDetails cad on cd.CustId=cad.CustId  where " + val + " like '" + textBox1.Text + "%'";
            DataTable dt          = dbMainClass.getDetailByQuery(selectQuery);

            dataGridView1.DataSource = dt;
        }
        private void button1_Click(object sender, EventArgs e)
        {
            string        selectquery1 = "select CustName,CustCompName,CustAddress,CustPhone,Custmobile,CustFax from CustomerDetails";
            DataTable     dt1          = d.getDetailByQuery(selectquery1);
            string        val          = " ";
            List <string> sd           = new List <string>();

            foreach (DataColumn dr in dt1.Columns)
            {
                val = dr.ColumnName;
                sd.Add(val);
            }
            comsearchsalesvalue.DataSource = sd;

            counter        = 0;
            panel2.Visible = true;
            string    selectquery = "select Custid, CustName,CustCompName,CustAddress,CustPhone,CustMobile,CustFax from customerdetails";
            DataTable dt          = d.getDetailByQuery(selectquery);

            dataGridView1.DataSource = dt;
        }
示例#8
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);
        }
示例#9
0
        private void Item_Load(object sender, EventArgs e)
        {
            string               selectqurry = "select itm.ItemName,itm.ItemCompName,itm.ItemDesc,itm.groupid,itm.Unitid,ipd.purChasePrice,ipd.SalesPrice,ipd.MrpPrice,ipd.Margin,iqd.OpeningQuantity,iqd.CurrentQuantity from ItemDetails itm join ItemPriceDetail ipd on itm.itemid=ipd.itemid join ItemQuantityDetail iqd on ipd.itemid=iqd.itemid";
            DataTable            dt          = dbMainClass.getDetailByQuery(selectqurry);
            List <string>        ls          = new List <string>();
            DataColumnCollection d           = dt.Columns;

            for (int a = 0; a < d.Count; a++)
            {
                //DataColumn dc = new DataColumn();
                string b = d[a].ToString();
                ls.Add(b);
            }

            searchCalmn.DataSource = ls;
            panel1.Visible         = false;
            string Id = dbMainClass.getUniqueID("ItemDetails");

            txtItemProductCode.Text = Id;
            if (Id == "l0001")
            {
                btnItemList.Enabled = false;
            }
            else
            {
                btnItemList.Enabled = true;
            }

            //setID();

            string selectCommandGroup = "select groupID,GROUPNAME,GROUPDESC from dbo.ItemGroup";

            setItemGroupDetail(selectCommandGroup, cmbItemItemGroup, "Group");

            string selectCommandUnit = "select unitID,unitName,unitDESC from dbo.ItemUnitList";

            setItemGroupDetail(selectCommandUnit, cmbItemUnit, "Unit");
        }
        private void salessearch_Load(object sender, EventArgs e)
        {
            string               selectquery = " select od.orderid,od.custid,itd.ItemName,cod.quantity,cod.totalammount,od.date,sod.DeliveryDate,si.invoicedate from orderdetails  od  join customerorderdescriptions cod on od.orderid=cod.orderid join salesOrderDelivery sod on cod.orderid=sod.orderid join salesinvoice si on sod.orderid=si.orderid join ItemDetails itd on cod.ItemId=itd.ItemId";
            DataTable            dt1         = d.getDetailByQuery(selectquery);
            List <string>        sd          = new List <string>();
            DataColumnCollection d1          = dt1.Columns;

            for (int a = 1; a < d1.Count; a++)
            {
                DataColumn dc  = new DataColumn();
                string     val = d1[a].ToString();
                sd.Add(val);
            }
            comboBox1.DataSource     = sd;
            dataGridView1.DataSource = dt1;
        }
        public DataTable getItemNameAndPricingDetails()
        {
            DataTable dt = new DataTable();

            try {
                string  Query = "select pd.ItemID, pd.SalesPrice,pd.PurChasePrice,pd.MrpPrice,pd.Margin, id.ItemName,id.ItemCompName,id.groupid,id.unitid from itempriceDetail pd  join ItemDetails id on pd.itemId=id.itemID";
                DB_Main db    = new DB_Main();
                dt = db.getDetailByQuery(Query);
            }
            catch (Exception ex)
            {
                dt.Clear();
            }
            return(dt);
        }
示例#12
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();
        }
示例#13
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();
            }
        }
示例#14
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;
        }