コード例 #1
0
        public void insert_Invoice_detalis(string InvoNo, DateTime InvoDate, string ino, string serial, string iname, decimal selsPrice, decimal purchPrice, string barcode, string catogory, string subCatory, string brande, string woraty, string supp, string tpe, string descrip, decimal pofit, string satus, string qty)
        {
            string     sql = @"INSERT INTO tbl_Invoice_details(Invoice_No,Invoice_Date,Item_No,Item_Name,Serial_No,Barcode,Sales_Price,Purchase_Price,Catogory,Sub_Catogory,Brande,Warranty,Supplier,Item_Type,Discription,Item_Profit,Status,Quntity)VALUES('" + InvoNo + "','" + InvoDate + "','" + ino + "','" + iname + "','" + serial + "','" + barcode + "','" + selsPrice + "','" + purchPrice + "','" + catogory + "','" + subCatory + "','" + brande + "','" + woraty + "','" + supp + "','" + tpe + "','" + descrip + "','" + pofit + "','" + satus + "','" + qty + "')";
            SqlCommand com = new SqlCommand(sql, ConnectionDB.Connection());

            com.ExecuteNonQuery();
        }
コード例 #2
0
        public void Update_rqst_odr(string ordNO, string Date, string Name, string mobile, string emal, string discrip, string ctgy, string subctgy, string brnd, string nme, decimal qty, string typ)
        {
            string     sql = "UPDATE tbl_Request_Order SET Order_Date='" + Date + "',Supplier='" + Name + "',Mobile='" + mobile + "',Discription='" + discrip + "',Email='" + emal + "',Name='" + nme + "',Catogory='" + ctgy + "',Sub_Catogory='" + subctgy + "',Brande='" + brnd + "',Item_Type='" + typ + "',Quntity='" + qty + "' WHERE Order_No='" + ordNO + "'";
            SqlCommand com = new SqlCommand(sql, ConnectionDB.Connection());

            com.ExecuteNonQuery();
        }
コード例 #3
0
        public void Update_R_stok_qty(string stok, string supp, string qqty)
        {
            string     sql = "UPDATE tbl_Recive_Stock SET Add_Count='" + qqty + "' WHERE Stock='" + stok + "' AND Supplier='" + supp + "'";
            SqlCommand com = new SqlCommand(sql, ConnectionDB.Connection());

            com.ExecuteNonQuery();
        }
コード例 #4
0
        public void Update(string ordNO, string Date, string Name, string mobile, string discrip)
        {
            string     sql = "UPDATE tbl_Customer_Order SET Date='" + Date + "',Name='" + Name + "',Mobile='" + mobile + "',Discription='" + discrip + "'WHERE Order_No='" + ordNO + "'";
            SqlCommand com = new SqlCommand(sql, ConnectionDB.Connection());

            com.ExecuteNonQuery();
        }
コード例 #5
0
        public void insert_stock(string sNo, DateTime sDate, string sSup, string sDis, string sPymthd, decimal sPrice, decimal sPaid, string ctgy, string sctgy, string brnd, int qty, string stc, decimal u_P_Piz, decimal u_s_piz, string itype, string imne, string ad_cout, string sroktyp)
        {
            string     sql = @"INSERT INTO tbl_Recive_Stock(Stock_No,Recive_date,Supplier,Discription,Purchase_Price,payment_Method,Payment,Catogory,Sub_Catogory,Brande,Quntity,Stock,Unit_purchas_price,Unit_sale_price,Item_Type,Item_Name,Add_Count,Stock_type)VALUES('" + sNo + "','" + sDate + "','" + sSup + "','" + sDis + "','" + sPrice + "','" + sPymthd + "','" + sPaid + "','" + ctgy + "','" + sctgy + "','" + brnd + "','" + qty + "','" + stc + "','" + u_P_Piz + "','" + u_s_piz + "','" + itype + "','" + imne + "','" + ad_cout + "','" + sroktyp + "')";
            SqlCommand com = new SqlCommand(sql, ConnectionDB.Connection());

            com.ExecuteNonQuery();
        }
コード例 #6
0
        private void Rpot_ReceivedStock_Load(object sender, EventArgs e)
        {
            dtpFrom = dateTimePicker_From;
            dtpTo   = dateTimePicker_to;
            cb_supp = cbxAddItemSupplier;


            DataSet        log = new DataSet();
            String         sql = "SELECT*FROM tbl_AddS_Supplier";
            SqlDataAdapter get = new SqlDataAdapter(sql, ConnectionDB.Connection());
            DataTable      ns  = new DataTable();

            get.Fill(ns);
            for (int i = 0; i < ns.Rows.Count; i++)
            {
                cbxAddItemSupplier.Items.Add(ns.Rows[i]["Business_Name"]);
            }



            pnl_Rpot_ReceiveS.Controls.Clear();
            Rpot_ReceiveStock1 rrecevi = new Rpot_ReceiveStock1();

            rrecevi.TopLevel = false;
            rrecevi.Visible  = true;
            pnl_Rpot_ReceiveS.Controls.Add(rrecevi);
        }
コード例 #7
0
        private void cbxAddItemCatogory_SelectedIndexChanged(object sender, EventArgs e)
        {
            String         scsql = "SELECT*FROM tbl_sub_catogory";
            SqlDataAdapter scget = new SqlDataAdapter(scsql, ConnectionDB.Connection());
            DataTable      scdt  = new DataTable();

            scget.Fill(scdt);
            for (int i = 0; i < scdt.Rows.Count; i++)
            {
                cbxAddItemSubCatogory.Items.Add(scdt.Rows[i]["sub_catogory"]);
            }


            cbxAddItemSubCatogory.Items.Clear();
            cbxAddItemSubCatogory.Text = "";
            String         sql = "SELECT sub_catogory FROM tbl_sub_catogory WHERE catogory='" + cbxAddItemCatogory.Text + "'";
            SqlDataAdapter get = new SqlDataAdapter(sql, ConnectionDB.Connection());
            DataTable      ns  = new DataTable();

            get.Fill(ns);
            for (int i = 0; i < ns.Rows.Count; i++)
            {
                cbxAddItemSubCatogory.Items.Add(ns.Rows[i]["sub_catogory"]);
            }
        }
        public void addWary_foundItm(string wtno, string invono, string itno, string itnme, string serial, string barcode, string catgry, string subCtogy, string brand, string itype, string descripn)
        {
            string     sql = @"INSERT INTO tbl_warrnty_found_Item(Warranty_No,Invoice_No,Item_No,Item_Name,Serial_No,Barcode,Catogory,Sub_Catogory,Brande,Item_Type,Discription)VALUES('" + wtno + "','" + invono + "','" + itno + "','" + itnme + "','" + serial + "','" + barcode + "','" + catgry + "','" + subCtogy + "','" + brand + "','" + itype + "','" + descripn + "')";
            SqlCommand com = new SqlCommand(sql, ConnectionDB.Connection());

            com.ExecuteNonQuery();
        }
        public void update_invoicItem(string invono, string itno, string itnme, string serial, string barcode, string catgry, string subCtogy, string brand)
        {
            string     sql = "UPDATE tbl_Invoice_details SET Item_Name='" + itnme + "',Serial_No='" + serial + "',Barcode='" + barcode + "',Catogory='" + catgry + "',Sub_Catogory='" + subCtogy + "',Brande='" + brand + "' WHERE Invoice_No='" + invono + "'AND Item_No='" + itno + "'";
            SqlCommand com = new SqlCommand(sql, ConnectionDB.Connection());

            com.ExecuteNonQuery();
        }
コード例 #10
0
        public void addWarranty(string wtno, string invono, string itno, string itnme, string serial, string barcode, string supp, string wtyfrom, string wtyto, string cusnme, string cusmob, string descript, string wtycomplte, string compteby)
        {
            string     sql = @"INSERT INTO tbl_Warranty(Warranty_No,Invoice_No,Item_No,Item_Name,Serial_No,Barcode,Supplier,Customer_Name,Customer_Mobile,Description,Warranty_Complete,Completed_by,Warranty_from,Warranty_to)VALUES('" + wtno + "','" + invono + "','" + itno + "','" + itnme + "','" + serial + "','" + barcode + "','" + supp + "','" + cusnme + "','" + cusmob + "','" + descript + "','" + wtycomplte + "','" + compteby + "','" + wtyfrom + "','" + wtyto + "')";
            SqlCommand com = new SqlCommand(sql, ConnectionDB.Connection());

            com.ExecuteNonQuery();
        }
コード例 #11
0
        public void updt_waty(string wno, string cmplteBy, string compt)
        {
            string     sql = "UPDATE tbl_Warranty SET Completed_by='" + cmplteBy + "',Warranty_Complete='" + compt + "' WHERE Warranty_No='" + wno + "'";
            SqlCommand com = new SqlCommand(sql, ConnectionDB.Connection());

            com.ExecuteNonQuery();
        }
コード例 #12
0
        public void insert_retn_itm(string ino, string serial, string iname, decimal selsPrice, decimal purchPrice, decimal tax, string barcode, string catogory, string subCatory, string brande, string itype, string supplier, string woraty, string discript)
        {
            string     sql = @"INSERT INTO tbl_Return_items(Item_No,Serial_No,Item_Name,Sales_Price,Purchase_Price,Tax_Rate,Barcode,Catogory,Sub_Catogory,Brande,Item_Type,Supplier,Warranty,Discription)VALUES('" + ino + "','" + serial + "','" + iname + "','" + selsPrice + "','" + purchPrice + "','" + tax + "','" + barcode + "','" + catogory + "','" + subCatory + "','" + brande + "','" + itype + "','" + supplier + "','" + woraty + "','" + discript + "')";
            SqlCommand com = new SqlCommand(sql, ConnectionDB.Connection());

            com.ExecuteNonQuery();
        }
コード例 #13
0
        public void update_item_status(string InvoNo, string ino, string stus)
        {
            string     sql = "UPDATE tbl_Invoice_details SET Status='" + stus + "' WHERE Invoice_No='" + InvoNo + "'AND Item_No='" + ino + "'";
            SqlCommand com = new SqlCommand(sql, ConnectionDB.Connection());

            com.ExecuteNonQuery();
        }
コード例 #14
0
        public void update_ChangeItem(string InvoNo, string ino, string serial, string iname, string selsPrice, string purchPrice, string barcode, string catogory, string subCatory, string brande, string woraty, string supp, string itype, string descrip, string ino2)
        {
            string     sql = "UPDATE tbl_Invoice_details SET Item_No='" + ino2 + "',Item_Name='" + iname + "',Serial_No='" + serial + "',Barcode='" + barcode + "',Sales_Price='" + selsPrice + "',Purchase_Price='" + purchPrice + "',Catogory='" + catogory + "',Sub_Catogory='" + subCatory + "',Brande='" + brande + "',Warranty='" + woraty + "',Supplier='" + supp + "',Item_Type='" + itype + "',Discription='" + descrip + "' WHERE Invoice_No='" + InvoNo + "'AND Item_No='" + ino + "'";
            SqlCommand com = new SqlCommand(sql, ConnectionDB.Connection());

            com.ExecuteNonQuery();
        }
コード例 #15
0
        public void Insert_Onwer_Acc(string UN, string Pass, string Con_Pass, string Sec_Q, string Sec_Ans)
        {
            string     sql = "INSERT INTO tbl_Admin_Accounts (User_Name,Password,Confirm_Password,Security_Qestion,Security_Answer) VALUES ('" + UN + "','" + Pass + "','" + Con_Pass + "','" + Sec_Q + "','" + Sec_Ans + "')";
            SqlCommand com = new SqlCommand(sql, ConnectionDB.Connection());

            com.ExecuteNonQuery();
        }
コード例 #16
0
        private void View_Requst_Order_Load(object sender, EventArgs e)
        {
            dgv_rqet = dgv_reqst_odr;

            if (Add_Receive_Strock.cbx_selet_request == true)
            {
                btn_select.Visible = true;
                btnEdit.Visible    = false;
                btnDelete.Visible  = false;
                cbx_view.Visible   = false;

                DataSet ds = odr.only_Not_Receiv_request_oder("Request");
                dgv_reqst_odr.DataSource = ds.Tables["tbl_Request_Order"];
                //dgv_reqst_odr.Columns["Discription"].Width = 250;
            }
            else
            {
                DataSet ds = odr.all_request_oder();
                dgv_reqst_odr.DataSource = ds.Tables["tbl_Request_Order"];
                //dgv_reqst_odr.Columns["Discription"].Width = 250;
            }



            String         sql = "SELECT*FROM tbl_AddS_Supplier";
            SqlDataAdapter get = new SqlDataAdapter(sql, ConnectionDB.Connection());
            DataTable      ns  = new DataTable();

            get.Fill(ns);
            for (int i = 0; i < ns.Rows.Count; i++)
            {
                cbxSupplier.Items.Add(ns.Rows[i]["Business_Name"]);
            }
        }
コード例 #17
0
        public void Update_Owner_acc(string unme_new, string Pass, string Con_Pass, string Sec_Q, string Sec_Ans, string unme_old)
        {
            string     sql = "UPDATE tbl_Admin_Accounts SET User_Name='" + unme_new + "', Password='******',Confirm_Password='******',Security_Qestion='" + Sec_Q + "',Security_Answer='" + Sec_Ans + "' WHERE User_Name='" + unme_old + "'";
            SqlCommand com = new SqlCommand(sql, ConnectionDB.Connection());

            com.ExecuteNonQuery();
        }
コード例 #18
0
        private void Return_stock_item_Load(object sender, EventArgs e)
        {
            string     sqlTrunc = "TRUNCATE TABLE " + "tbl_Invoice_Item";
            SqlCommand cmd      = new SqlCommand(sqlTrunc, ConnectionDB.Connection());

            cmd.ExecuteNonQuery();



            //lbl_CurrentMoney.Text = Add_Warranty.dgvaddw.CurrentRow.Cells["Sales_Price"].Value.ToString();
            dgvFind_warrny        = dgvFindItem;
            btn_clikStk           = true;
            lbl_CurrentMoney.Text = wty_dtail_inconplete.salPriz;


            ds = Invo.all_Item();
            dgvFindItem.DataSource = ds.Tables["tbl_Invoice_Item"];



            txt_paid.Enabled   = false;
            txt_balnce.Enabled = false;
            tx_berd            = txt_bcrd;

            txt_bcrd.Focus();
        }
コード例 #19
0
        private void View_Suppliers_Load(object sender, EventArgs e)
        {
            dgv = dgvViewSupp;
            DataSet ds = supOp.all();

            dgvViewSupp.DataSource = ds.Tables["tbl_AddS_Supplier"];



            string         sql = "SELECT * FROM tbl_AddS_Supplier";
            SqlDataAdapter da  = new SqlDataAdapter(sql, ConnectionDB.Connection());

            dtbl = new DataTable();
            da.Fill(dtbl);
            BindingSource bnsue = new BindingSource();

            bnsue.DataSource       = dtbl;
            dgvViewSupp.DataSource = bnsue;
            da.Update(dtbl);


            if (Main.UT1 == "Standard User")
            {
                btnViewSuppViewAcc.Enabled = false;
            }
        }
コード例 #20
0
        private void custormizeRestorToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                OpenFileDialog R_path = new OpenFileDialog();
                R_path.Filter      = "Backup Files(*.bak)|*.bak|All Files(*.*)|*.*";
                R_path.FilterIndex = 0;
                if (R_path.ShowDialog() == DialogResult.OK)
                {
                    Rpth = R_path.FileName;


                    string sql = "Alter Database [" + System.Windows.Forms.Application.StartupPath + "\\InventoryDB_tmp.mdf] Set SINGLE_USER WITH ROLLBACK IMMEDIATE use master;";
                    sql += "Restore Database [" + System.Windows.Forms.Application.StartupPath + "\\InventoryDB_tmp.mdf] FROM Disk = '" + Rpth + "' WITH REPLACE;";
                    SqlCommand com = new SqlCommand(sql, ConnectionDB.Connection_tmp());
                    com.ExecuteNonQuery();

                    ConnectionDB.Connection().Close();
                    ConnectionDB.Connection().Dispose();



                    Restor reto = new Restor();
                    reto.ShowDialog();
                }
            }
            catch (Exception w) { MessageBox.Show(w.Message); }
        }
コード例 #21
0
        private void cbxFindItemCategory_SelectedIndexChanged(object sender, EventArgs e)
        {
            cbxFindItemSubCategory.Items.Clear();
            cbxFindItemSubCategory.Text = "";
            String         sql = "SELECT sub_catogory FROM tbl_sub_catogory WHERE catogory='" + cbxFindItemCategory.Text + "'";
            SqlDataAdapter get = new SqlDataAdapter(sql, ConnectionDB.Connection());
            DataTable      ns  = new DataTable();

            get.Fill(ns);
            for (int i = 0; i < ns.Rows.Count; i++)
            {
                cbxFindItemSubCategory.Items.Add(ns.Rows[i]["sub_catogory"]);
            }


            string         sqlfilter_catgory = "SELECT * FROM tbl_Add_Items";
            SqlDataAdapter da = new SqlDataAdapter(sqlfilter_catgory, ConnectionDB.Connection());

            dtbl = new DataTable();
            da.Fill(dtbl);
            BindingSource bnsue = new BindingSource();

            bnsue.DataSource       = dtbl;
            dgvFindItem.DataSource = bnsue;
            da.Update(dtbl);

            DataView dv = new DataView(dtbl);

            dv.RowFilter           = "Catogory like '%" + cbxFindItemCategory.SelectedItem + "%' ";
            dgvFindItem.DataSource = dv;
        }
コード例 #22
0
        private void masterRestorToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                OpenFileDialog R_path = new OpenFileDialog();
                R_path.Filter      = "Backup Files(*.bak)|*.bak|All Files(*.*)|*.*";
                R_path.FilterIndex = 0;
                if (R_path.ShowDialog() == DialogResult.OK)
                {
                    Rpth = R_path.FileName;


                    string sql = "Alter Database [" + System.Windows.Forms.Application.StartupPath + "\\InventoryDB.mdf] Set SINGLE_USER WITH ROLLBACK IMMEDIATE use master;";
                    sql += "Restore Database [" + System.Windows.Forms.Application.StartupPath + "\\InventoryDB.mdf] FROM Disk = '" + Rpth + "' WITH REPLACE;";
                    SqlCommand com = new SqlCommand(sql, ConnectionDB.Connection());
                    com.ExecuteNonQuery();

                    ConnectionDB.Connection().Close();
                    ConnectionDB.Connection().Dispose();



                    if (MessageBox.Show("Restor Database Sucessfully..!. \nInventory Control now will restart.", "Sharp Creation", MessageBoxButtons.OK, MessageBoxIcon.Information) == DialogResult.OK)
                    {
                        rstor = true;
                        Application.Restart();
                    }
                }
            }
            catch (Exception w) { MessageBox.Show(w.Message); }
        }
コード例 #23
0
        public void delete_rqst_odr(string No)
        {
            string     sql = "DELETE FROM tbl_Request_Order WHERE Order_No='" + No + "'";
            SqlCommand com = new SqlCommand(sql, ConnectionDB.Connection());

            com.ExecuteNonQuery();
        }
コード例 #24
0
        private void Rpot_ItemList_Load(object sender, EventArgs e)
        {
            cb_ctgy    = cbx_ctgy;
            cb_Subctgy = cbx_subctgy;


            pnl_itmlst.Controls.Clear();
            Rpot_ItemList1 ilist1 = new Rpot_ItemList1();

            ilist1.TopLevel = false;
            ilist1.Visible  = true;
            pnl_itmlst.Controls.Add(ilist1);



            String         csql = "SELECT*FROM tbl_catogory";
            SqlDataAdapter cget = new SqlDataAdapter(csql, ConnectionDB.Connection());
            DataTable      cdt  = new DataTable();

            cget.Fill(cdt);
            for (int i = 0; i < cdt.Rows.Count; i++)
            {
                cbx_ctgy.Items.Add(cdt.Rows[i]["catogory"]);
            }
        }
コード例 #25
0
        public void insert_reqstO(string ordNO, DateTime Date, string sName, string mobile, string eml, string discrip, string odrr, string ctgy, string subctgy, string brnd, string nme, decimal qty, string typ)
        {
            string     sql = @"INSERT INTO tbl_Request_Order(Order_No,Order_Date,Supplier,Mobile,Email,Discription,Oder,Name,Catogory,Sub_Catogory,Brande,Item_Type,Quntity)VALUES('" + ordNO + "','" + Date + "','" + sName + "','" + mobile + "','" + eml + "','" + discrip + "','" + odrr + "','" + nme + "','" + ctgy + "','" + subctgy + "','" + brnd + "','" + typ + "','" + qty + "')";
            SqlCommand com = new SqlCommand(sql, ConnectionDB.Connection());

            com.ExecuteNonQuery();
        }
コード例 #26
0
        //________START___________________________insert New Acc--(User_Account)________________________________________________________________
        public void insert
        (
            string FName,
            string LName,
            string NIC,

            string Mob,
            string Add1,
            string Add2,
            string Email,

            string date,
            string userType,
            string userName,
            string Pass,
            string conPass,
            string security_q,
            string security_ans
        )
        {
            string     sql = "INSERT INTO tbl_UserAccount(First_Name,Last_Name,NIC,Mobile,Address_Line1,Address_Line2,Email,Date,User_Type,User_Name,Password,Confirm_Password,Security_Qestion,Security_Answer) VALUES ('" + FName + "','" + LName + "','" + NIC + "','" + Mob + "','" + Add1 + "','" + Add2 + "','" + Email + "','" + date + "','" + userType + "','" + userName + "','" + Pass + "','" + conPass + "','" + security_q + "','" + security_ans + "')";
            SqlCommand com = new SqlCommand(sql, ConnectionDB.Connection());

            com.ExecuteNonQuery();
        }
コード例 #27
0
        public void Update_rqst_odr2(string ordNO, string oddr)
        {
            string     sql = "UPDATE tbl_Request_Order SET Oder='" + oddr + "' WHERE Order_No='" + ordNO + "'";
            SqlCommand com = new SqlCommand(sql, ConnectionDB.Connection());

            com.ExecuteNonQuery();
        }
コード例 #28
0
        public void set_sal_tgt(string unme, decimal m_sal, decimal m_tget)
        {
            string     sql = @"INSERT INTO tbl_Salary_And_Target(User_Name,Monthly_Salary,Monthly_Trget)VALUES('" + unme + "','" + m_sal + "','" + m_tget + "')";
            SqlCommand com = new SqlCommand(sql, ConnectionDB.Connection());

            com.ExecuteNonQuery();
        }
コード例 #29
0
        public void insert(string ordNO, string Date, string Name, string mobile, string discrip)
        {
            string     sql = @"INSERT INTO tbl_Customer_Order(Order_No,Date,Name,Mobile,Discription)VALUES('" + ordNO + "','" + Date + "','" + Name + "','" + mobile + "','" + discrip + "')";
            SqlCommand com = new SqlCommand(sql, ConnectionDB.Connection());

            com.ExecuteNonQuery();
        }
コード例 #30
0
        public void insert_Invoice(string ivno, DateTime ivDate, decimal totPrice, decimal paidPrice, decimal balnce, string method, string discip, string slRef, string custNO, decimal grdtot, decimal disc, decimal tax, string pymnt)
        {
            string     sql = @"INSERT INTO tbl_Invoice(Invoice_No,Invoice_Date,Description,Total_Price,Paid_Price,Balance,Payment_Method,Coustomer_No,Seals_ref,Grande_total,Discount,Tax,Payment)VALUES('" + ivno + "','" + ivDate + "','" + discip + "','" + totPrice + "','" + paidPrice + "','" + balnce + "','" + method + "','" + custNO + "','" + slRef + "','" + grdtot + "','" + disc + "','" + tax + "','" + pymnt + "')";
            SqlCommand com = new SqlCommand(sql, ConnectionDB.Connection());

            com.ExecuteNonQuery();
        }