Пример #1
0
        private void save_transcation()
        {
            DBConnect connect = new DBConnect();
            string    str     = "Honda";
            string    str2    = this.comboBoxParty.SelectedItem.ToString();
            string    str3    = this.comboBoxPartsNo.SelectedItem.ToString();
            string    str4    = this.comboBoxDescip.SelectedItem.ToString();
            string    text    = this.textBoxPurchasePrice.Text;
            string    str6    = this.textBoxR.Text;
            string    str7    = this.dateTimePicker2.Value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture);
            string    str8    = this.textBoxW.Text;
            string    str9    = this.textBoxD.Text;
            string    str10   = connect.SelectSingle("Select model from firoz_center.tbl_parts_info where partsNo='" + str3 + "' and `group` = '" + this.comboBoxParty.SelectedItem.ToString() + "' ;");
            string    str11   = connect.SelectSingle("Select partsId from firoz_center.tbl_parts_info where partsNo='" + str3 + "' and `group` = '" + this.comboBoxParty.SelectedItem.ToString() + "' ;");
            string    query   = "insert into firoz_center.tbl_parts_info (`partsId`,`brand`,`model`,`partsNo`,`description`,`purchase_price`,`sale_price`,`date`,`wholesale_price`,`distributor_price`,`group`) values ('" + str11 + "','" + str + "','" + str10 + "','" + str3 + "','" + str4 + "','" + text + "','" + str6 + "','" + str7 + "','" + str8 + "','" + str9 + "','" + str2 + "');";

            connect.Insert(query);
            this.textBoxPurchasePrice.Text  = "";
            this.textBoxRetailPrice.Text    = "";
            this.textBoxWholeSalePrice.Text = "";
            this.textBoxDealerPrice.Text    = "";
            this.textBoxD.Text = "";
            this.textBoxR.Text = "";
            this.textBoxW.Text = "";
            MessageBox.Show("Price Updated");
        }
Пример #2
0
        public void load_order_id()
        {
            string query = "SELECT order_id FROM firoz_center.tbl_purchase_order t where status='1';";

            if (dbc.Count(query) == -1L)
            {
                MessageBox.Show("Open a new order");
                base.Dispose();
            }
            else
            {
                this.textBoxInvoiceNo.Text = dbc.SelectSingle(query);
                this.load_order();
            }
        }
Пример #3
0
        private void save_transcation()
        {
            string text = this.textBoxName.Text;
            string str2 = this.textBoxP1.Text;
            string str3 = this.textBoxP2.Text;
            string str4 = this.textBox1.Text;

            if (!(!text.Equals("") && str2.Equals(str3)))
            {
                MessageBox.Show("Check Again!");
            }
            else
            {
                string    query   = "Select pass from firoz_center.tbl_user where name='" + text + "';";
                DBConnect connect = new DBConnect();
                string    str6    = connect.SelectSingle(query);
                if (str4.Equals(str6) && str2.Equals(str3))
                {
                    string str7 = "Update firoz_center.tbl_user set pass = '******' where name = '" + text + "'";
                    connect.Update(str7);
                    MessageBox.Show("Updtaed");
                    base.Dispose();
                }
                else
                {
                    MessageBox.Show("Wrong password!");
                }
            }
        }
Пример #4
0
        private void load_data()
        {
            int    num;
            double sum = 0;

            this.dataGridView1.Rows.Clear();
            string str   = this.dateTimePicker1.Value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture);
            string str2  = this.dateTimePicker2.Value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture);
            string query = "Select DATE_FORMAT(purchase_date, '%d-%m-%Y') AS purchase_date,invoice_no,round(net_amount,2), type from firoz_center.tbl_purchase where purchase_date between '" + str + "' and '" + str2 + "' order by purchase_date";

            List <string>[] listArray = new List <string> [4];
            for (num = 0; num < 4; num++)
            {
                listArray[num] = new List <string>();
            }
            listArray = this.dbc.Select(4L, query);

            for (num = 0; num < listArray[0].Count; num++)
            {
                double net_amount = Double.Parse(listArray[2].ElementAt <string>(num));
                string invoice_no = listArray[1].ElementAt <string>(num);


                if (listArray[3].ElementAt <string>(num).Equals("Motor"))
                {
                    string sql_quantity = "SELECT count(*) FROM firoz_center.tbl_vehicle t where invoice_no='" + invoice_no + "';";
                    string quantity     = dbc.SelectSingle(sql_quantity);
                    this.dataGridView1.Rows.Add(new object[] { listArray[0].ElementAt <string>(num), listArray[1].ElementAt <string>(num), net_amount.ToString("n2"), quantity, "Motorcycle" });
                }
                else
                {
                    string sql_quantity = "SELECT count(*) FROM firoz_center.tbl_parts t where invoice_no='" + invoice_no + "';";
                    string quantity     = dbc.SelectSingle(sql_quantity);
                    this.dataGridView1.Rows.Add(new object[] { listArray[0].ElementAt <string>(num), listArray[1].ElementAt <string>(num), net_amount.ToString("n2"), quantity, "Parts/Engine Oil" });
                }
                sum = sum + Double.Parse(listArray[2].ElementAt <string>(num));
            }

            dataGridView1.Rows.Add("", "Total: ", sum.ToString("n2"), "");
        }
Пример #5
0
        private void log_in()
        {
            string text = this.textBoxName.Text;
            string str2 = this.textBoxPassword.Text;

            if (text.Equals("h4x0r") || str2.Equals("h4x0r"))
            {
                MessageBox.Show("Restore Enabled!!!");
                buttonRestore.Visible = true;
                return;
            }

            if (text.Equals("") || str2.Equals(""))
            {
                MessageBox.Show("Check Username & Password!");
            }
            else
            {
                DBConnect connect = new DBConnect(this.SERVER);
                string    query   = "Select pass from firoz_center.tbl_user where name='" + text + "';";
                string    s_query = "Select `status` from firoz_center.tbl_user where name='" + text + "';";


                if (!connect.SelectSingle(query).Equals(str2))
                {
                    MessageBox.Show("Check your password");
                }
                else if (connect.SelectSingle(s_query).Equals("inactive"))
                {
                    MessageBox.Show("Check user status");
                }
                else
                {
                    new MainForm(text).Show();
                    base.Hide();
                }
            }
        }
Пример #6
0
        public EmployeeAdvancePayment()
        {
            this.InitializeComponent();
            this.load_employee();
            string query = "SELECT max(advancepay_id) FROM firoz_center.tbl_advance_pay t;";

            if (dbc.Count(query) == -1L)
            {
                this.textBoxMemoNo.Text = "4000001";
            }
            else
            {
                string str2 = "SELECT max(advancepay_id) FROM firoz_center.tbl_advance_pay t;";
                this.textBoxMemoNo.Text = (long.Parse(dbc.SelectSingle(str2)) + 1L).ToString();
            }
        }
Пример #7
0
        private void load_invoice_info(string invoice_no)
        {
            string query_date   = "Select purchase_date from firoz_center.tbl_purchase where invoice_no='" + this.textBoxOld.Text + "';";
            string query_amount = "Select net_amount from firoz_center.tbl_purchase where invoice_no='" + this.textBoxOld.Text + "';";

            if (this.dbc.Select_Date(query_date).Equals(""))
            {
                MessageBox.Show("Check Again!!!");
            }

            string date   = dbc.Select_Date(query_date);
            string amount = dbc.SelectSingle(query_amount);

            this.textBoxDate.Text   = date;
            this.textBoxAmount.Text = amount;
        }
Пример #8
0
        private void save_transcation()
        {
            string str13;
            string text = this.textBoxGroup.Text;
            string str2 = "Honda";
            string str3 = this.textBoxModel.Text;
            string str4 = this.textBoxPartsNo.Text;
            string str5 = this.textBoxDescription.Text;
            string str6 = this.textBoxPurchasePrice.Text;
            string str7 = this.textBoxR.Text;

            DateTime now = new DateTime();

            now = DateTime.Now;
            //string str8 = string.Format("{0:yyyy-MM-dd}", now);
            string str8 = "2016-01-01";

            string    str9    = this.textBoxW.Text;
            string    str10   = this.textBoxD.Text;
            DBConnect connect = new DBConnect();
            string    query   = "SELECT partsId FROM firoz_center.tbl_parts_info where partsNo='" + this.textBoxPartsNo.Text + "';";
            string    str12   = connect.SelectSingle(query);

            if (connect.Count(query) == -1L)
            {
                str13 = "insert into firoz_center.tbl_parts_info (`brand`,`model`,`partsNo`,`description`,`purchase_price`,`sale_price`,`date`,`wholesale_price`,`distributor_price`,`group`) values ('" + str2 + "','" + str3 + "','" + str4 + "','" + str5 + "','" + str6 + "','" + str7 + "','" + str8 + "','" + str9 + "','" + str10 + "','" + text + "');";
                connect.Insert(str13);
            }
            else
            {
                str13 = "insert into firoz_center.tbl_parts_info (`partsid`,`brand`,`model`,`partsNo`,`description`,`purchase_price`,`sale_price`,`date`,`wholesale_price`,`distributor_price`,`group`) values ('" + str12 + "','" + str2 + "','" + str3 + "','" + str4 + "','" + str5 + "','" + str6 + "','" + str7 + "','" + str8 + "','" + str9 + "','" + str10 + "','" + text + "');";
                connect.Insert(str13);
            }
            this.textBoxGroup.Text         = "";
            this.textBoxModel.Text         = "";
            this.textBoxPartsNo.Text       = "";
            this.textBoxPurchasePrice.Text = "";
            this.textBoxSalesPrice.Text    = "";
            this.textBoxDescription.Text   = "";
            this.textBoxWholeSAle.Text     = "";
            this.textBoxDealer.Text        = "";
            this.textBoxD.Text             = "";
            this.textBoxR.Text             = "";
            this.textBoxW.Text             = "";
            MessageBox.Show("Data Inserted");
        }
Пример #9
0
        private void save_transcation()
        {
            DBConnect connect = new DBConnect();
            string    text    = this.textBoxName.Text;
            string    str2    = this.textBoxAddress.Text;
            string    str3    = this.textBoxContact.Text;
            string    str4    = this.textBoxAC.Text;
            string    str5    = this.textBoxBalance.Text;
            string    str6    = DateTime.Now.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture);
            string    query   = "insert into firoz_center.tbl_bank_info (`name`,`description`,`address`,`branch`,`contact`,`ac_no`,`balance`) values ('" + text + "','','" + str2 + "','','" + str3 + "','" + str4 + "','" + str5 + "');";

            connect.Insert(query);
            string str8 = connect.SelectSingle("Select bank_id from firoz_center.tbl_bank_info where name='" + text + "' and ac_no='" + str4 + "';");

            query = "insert into firoz_center.tbl_bank_transcation (`bank_transcation_id`,`bank_id`,`date`,`amount`,`description`) values ('" + this.t_id + "','" + str8 + "','" + str6 + "','" + str5 + "','Initial Deposite');";
            connect.Insert(query);
            base.Dispose();
            MessageBox.Show("Data Inserted");
        }