public void LoadSalesReturn()
        {
            ListBox lb = new ListBox();

            lb.Items.Add(salesreturnIDGV);

            lb.Items.Add(dateGV);

            lb.Items.Add(salesinvoiceIDGV);

            lb.Items.Add(userIDGV);

            lb.Items.Add(userGV);

            lb.Items.Add(billnoGV);

            lb.Items.Add(customernameGV);

            lb.Items.Add(customerIDGV);

            lb.Items.Add(shopIDGV);

            lb.Items.Add(shopGV);

            lb.Items.Add(amountGV);

            Hashtable ht = new Hashtable();

            ht.Add("@data", search_textBox.Text);

            SQL_TASKS.load_data("st_searchSALESRETURN", salesreturn_dataGridView, lb, ht);
        }
Example #2
0
        private void PAYMENT_Load(object sender, EventArgs e)
        {
            try
            {
                edit_button.Enabled = false;

                LoadPayments();

                SQL_TASKS.LoadList("st_getSHOPS", shop_comboBox_payments, "ID", "Name");

                cheque_no_textBox.Visible = false; cheque_no_label.Visible = false;

                bank_and_branch_label.Visible = false; bank_and_branch_textBox.Visible = false;

                clearing_date_label.Visible = false; clearing_date_dateTimePicker.Visible = false;

                base.edit_button.Text = "CANNOT EDIT";

                CodingSourceClass.disable_reset(left_panel);
            }
            catch (Exception ex)
            {
                CodingSourceClass.ShowMsg(ex.Message, "Error");

                CodingSourceClass.disable_reset(left_panel);

                enable_crud_buttons();
            }
        }
Example #3
0
        public override void search_textBox_TextChanged(object sender, EventArgs e)
        {
            if (search_textBox.Text != "")
            {
                ListBox lb = new ListBox();

                lb.Items.Add(ShopIDGV);

                lb.Items.Add(ShopnameGV);

                lb.Items.Add(VendorIDGV);

                lb.Items.Add(VendorGV);

                lb.Items.Add(BranchnameGV);

                lb.Items.Add(ManagerIDGV);

                lb.Items.Add(ManagerGV);

                Hashtable ht = new Hashtable();

                ht.Add("@data", search_textBox.Text);

                SQL_TASKS.load_data("st_searchSHOPS", shops_dataGridView, lb, ht);
            }
            else
            {
                LoadShops();
            }
        }
        public override void search_textBox_TextChanged(object sender, EventArgs e)
        {
            if (search_textBox.Text != "")
            {
                ListBox lb = new ListBox();

                lb.Items.Add(VendorIDGV);

                lb.Items.Add(NameGV);

                lb.Items.Add(PhoneGV);

                lb.Items.Add(AddressGV);

                Hashtable ht = new Hashtable();

                ht.Add("@data", search_textBox.Text);

                SQL_TASKS.load_data("st_searchVENDORS", vendors_dataGridView, lb, ht);
            }
            else
            {
                LoadVendors();
            }
        }
Example #5
0
        public void LoadSalesInvoice()
        {
            ListBox lb = new ListBox();

            lb.Items.Add(salesIDGV);

            lb.Items.Add(shopIDGV);

            lb.Items.Add(customerIDGV);

            lb.Items.Add(detailsGV);

            lb.Items.Add(amountGV);

            lb.Items.Add(typeGV);

            lb.Items.Add(userIDGV);

            lb.Items.Add(billnoGV);

            lb.Items.Add(statusGV);

            lb.Items.Add(customernameGV);

            lb.Items.Add(shopGV);

            lb.Items.Add(userGV);

            SQL_TASKS.load_data("st_getSALESINVOICE", salesinvoice_dataGridView, lb);
        }
Example #6
0
        public override void search_textBox_TextChanged(object sender, EventArgs e)
        {
            if (search_textBox.Text != "")
            {
                ListBox lb = new ListBox();

                lb.Items.Add(CustomerIDGV);

                lb.Items.Add(CustomernameGV);

                lb.Items.Add(CustomerphoneGV);

                lb.Items.Add(ShopIDGV);

                lb.Items.Add(CustomeremailGV);

                Hashtable ht = new Hashtable();

                ht.Add("@data", search_textBox.Text);

                SQL_TASKS.load_data("st_searchCUSTOMERS", customers_dataGridView, lb, ht);
            }
            else
            {
                LoadCustomers();
            }
        }
Example #7
0
        private void sales_invoice_comboBox_payments_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (sales_invoice_comboBox_payments.SelectedIndex != -1)
                {
                    Hashtable ht = new Hashtable();

                    ht.Add("@custID", Convert.ToInt32(customer_comboBox_payments.SelectedValue.ToString()));

                    ht.Add("@salesinvoiceID", Convert.ToInt64(sales_invoice_comboBox_payments.SelectedValue.ToString()));

                    double[] arr = SQL_TASKS.SaleInvoiceAmounts("st_getSALESINVOICEAMOUNT", ht);

                    total_amount_textBox_payments.Text = arr[0].ToString();

                    amount_paid_textBox_payments.Text = arr[1].ToString();

                    remaining_amount_textBox_payments.Text = arr[2].ToString();
                }
            }
            catch (Exception ex)
            {
                CodingSourceClass.ShowMsg(ex.Message, "Error");

                CodingSourceClass.disable_reset(left_panel); enable_crud_buttons();
            }
        }
        private void SALES_RETURN_Load(object sender, EventArgs e)
        {
            try
            {
                CodingSourceClass.disable_reset(left_panel);

                edit_button.Enabled = false; delete_button.Enabled = false;

                LoadSalesReturn();

                SQL_TASKS.LoadList("st_getSHOPS", shop_comboBox_salesreturn, "ID", "Name");

                base.delete_button.Text = "CANNOT DELETE"; base.delete_button.Enabled = false;

                base.edit_button.Text = "CANNOT EDIT"; base.edit_button.Enabled = false;
            }
            catch (Exception ex)
            {
                CodingSourceClass.ShowMsg(ex.Message, "Error");

                CodingSourceClass.disable_reset(left_panel);

                enable_crud_buttons();
            }
        }
Example #9
0
        public void LoadPayments()
        {
            ListBox lb = new ListBox();

            lb.Items.Add(paymentsIDGV);

            lb.Items.Add(dateGV);

            lb.Items.Add(salesinvoiceIDGV);

            lb.Items.Add(userIDGV);

            lb.Items.Add(userGV);

            lb.Items.Add(billnoGV);

            lb.Items.Add(customernameGV);

            lb.Items.Add(customerIDGV);

            lb.Items.Add(shopIDGV);

            lb.Items.Add(shopGV);

            lb.Items.Add(amountGV);

            lb.Items.Add(ChequenoGV);

            lb.Items.Add(bankGV);

            lb.Items.Add(clearingdateGV);

            SQL_TASKS.load_data("st_getPAYMENTS", payments_dataGridView, lb);
        }
Example #10
0
        private void customer_comboBox_payments_Enter(object sender, EventArgs e)
        {
            if (shop_comboBox_payments.SelectedIndex != -1)
            {
                customer_comboBox_payments.DataSource = null;

                SQL_TASKS.LoadList("st_getCUSTOMERSwrtSHOPS", customer_comboBox_payments, "Customer ID", "Customer Name", "@id", Convert.ToInt32(shop_comboBox_payments.SelectedValue));
            }
        }
Example #11
0
        private void sales_invoice_comboBox_payments_Enter(object sender, EventArgs e)
        {
            if (customer_comboBox_payments.SelectedIndex != -1)
            {
                sales_invoice_comboBox_payments.DataSource = null;

                SQL_TASKS.LoadList("st_getsSALESINVOICEwrtCUSTOMER", sales_invoice_comboBox_payments, "ID", "BillNo", "@id", Convert.ToInt32(customer_comboBox_payments.SelectedValue));
            }
        }
Example #12
0
        public override void view_button_Click(object sender, EventArgs e)
        {
            CodingSourceClass.disable_reset(left_panel);

            LoadRoles();

            CodingSourceClass.disable_reset(left_panel);

            SQL_TASKS.TotalRecords("getTOTALROLES", total_roles_label);
        }
Example #13
0
        public void LoadRoles()
        {
            ListBox lb = new ListBox();

            lb.Items.Add(RoleIDGV);

            lb.Items.Add(RoleGV);

            SQL_TASKS.load_data("st_getROLES", roles_dataGridView, lb);
        }
Example #14
0
        private void ROLES_Load(object sender, EventArgs e)
        {
            LoadRoles();

            SQL_TASKS.TotalRecords("getTOTALROLES", total_roles_label);

            CodingSourceClass.disable_reset(left_panel);

            enable_crud_buttons(); //add,delete,update.....
        }
Example #15
0
        private void customers_Load(object sender, EventArgs e)
        {
            SQL_TASKS.LoadList("st_getSHOPS", shops_comboBox_customers, "ID", "Name");

            CodingSourceClass.disable_reset(left_panel);

            enable_crud_buttons();

            LoadCustomers();
        }
Example #16
0
        private void USERS_Load(object sender, EventArgs e)
        {
            LoadUsers();

            SQL_TASKS.LoadList("st_getROLESdata", roles_comboBox, "ID", "Role");

            enable_crud_buttons();

            CodingSourceClass.disable_reset(left_panel);
        }
        private void save_new_details_button_change_Click(object sender, EventArgs e)
        {
            try
            {
                if (new_password_textBox_change.Text != "" && admin_radioButton.Checked == true && other_radioButton.Checked == false)
                {
                    Hashtable ht = new Hashtable();

                    ht.Add("@username", usernameGLOBAL);

                    ht.Add("@password", new_password_textBox_change.Text);

                    if (SQL_TASKS.insert_update_delete("st_updateAdminPASSWORD", ht) > 0)
                    {
                        CodingSourceClass.ShowMsg("Password changed successfully.", "Success");

                        clear(); sq.Close();
                    }
                    else
                    {
                        throw new Exception("An error occured.");
                    }
                }
                else if (new_password_textBox_change.Text != "" && admin_radioButton.Checked == false && other_radioButton.Checked == true)
                {
                    Hashtable ht = new Hashtable();

                    ht.Add("@username", usernameGLOBAL);

                    ht.Add("@password", new_password_textBox_change.Text);

                    if (SQL_TASKS.insert_update_delete("st_updateUSERPASSWORD", ht) > 0)
                    {
                        CodingSourceClass.ShowMsg("Password changed successfully.", "Success");

                        clear(); sq.Close();
                    }
                    else
                    {
                        throw new Exception("An error occured.");
                    }
                }
                else
                {
                    throw new Exception("Please fill all required fields properly.");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

                sq.Close();
            }
        }
Example #18
0
        private void shops_Load(object sender, EventArgs e)
        {
            SQL_TASKS.LoadList("st_getVENDORSdata", vendors_comboBox_shops, "ID", "Vendor Name");

            SQL_TASKS.LoadList("st_getUSERSwrtMANAGERS", managers_comboBox_shops, "ID", "Name");

            CodingSourceClass.enable_reset(left_panel);

            enable_crud_buttons();

            LoadShops();
        }
Example #19
0
        public override void delete_button_Click(object sender, EventArgs e)
        {
            try
            {
                if (roles_textBox.Text != "" && roles_textBox.Enabled == false)
                {
                    Hashtable ht = new Hashtable();

                    DialogResult dr = MessageBox.Show("Are you sure? ", "Question.....", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                    if (dr == DialogResult.Yes)
                    {
                        //key ,  value
                        ht.Add("@id", roleID);

                        if (SQL_TASKS.insert_update_delete("st_deleteROLES", ht) > 0)
                        {
                            MainClass.CodingSourceClass.ShowMsg(roles_textBox.Text + " deleted successfully from the system.", "Success");

                            CodingSourceClass.disable_reset(left_panel);

                            enable_crud_buttons();

                            LoadRoles();

                            SQL_TASKS.TotalRecords("getTOTALROLES", total_roles_label);
                        }
                        else
                        {
                            CodingSourceClass.ShowMsg("Unable to delete.", "Error");

                            CodingSourceClass.disable_reset(left_panel);

                            enable_crud_buttons();
                        }
                    }
                }
                else
                {
                    CodingSourceClass.ShowMsg("Select a record to delete.", "Error");

                    enable_crud_buttons();

                    CodingSourceClass.disable_reset(left_panel);
                }
            }
            catch (Exception ex)
            {
                CodingSourceClass.ShowMsg(ex.Message, "Error");

                CodingSourceClass.disable_reset(left_panel); enable_crud_buttons();
            }
        }
        void LoadVendors()
        {
            ListBox lb = new ListBox();

            lb.Items.Add(VendorIDGV);

            lb.Items.Add(NameGV);

            lb.Items.Add(PhoneGV);

            lb.Items.Add(AddressGV);

            SQL_TASKS.load_data("st_getVENDORSdata", vendors_dataGridView, lb);
        }
Example #21
0
        public override void delete_button_Click(object sender, EventArgs e)
        {
            try
            {
                if (name_textBox.Text != "" && phone_textBox.Text != "" && address_textBox.Text != "" && password_textBox.Text != "" && username_textBox.Text != "" && roles_comboBox.SelectedIndex != -1)
                {
                    Hashtable ht = new Hashtable();

                    DialogResult dr = MessageBox.Show("Are you sure? ", "Question.....", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                    if (dr == DialogResult.Yes)
                    {
                        ht.Add("@id", userID);

                        if (SQL_TASKS.insert_update_delete("st_deleteUSERS", ht) > 0)
                        {
                            CodingSourceClass.ShowMsg("Record deleted successfully from the system.", "Success");

                            enable_crud_buttons();

                            CodingSourceClass.disable_reset(left_panel);

                            LoadUsers();
                        }
                        else
                        {
                            CodingSourceClass.ShowMsg("Unable to delete.An error occured.", "Error");

                            enable_crud_buttons();

                            CodingSourceClass.disable_reset(left_panel);
                        }
                    }
                }
                else
                {
                    throw new Exception("Select a record to delete.");
                }
            }
            catch (Exception ex)
            {
                CodingSourceClass.ShowMsg(ex.Message, "Error");

                CodingSourceClass.disable_reset(left_panel); enable_crud_buttons();
            }
        }
Example #22
0
        public override void delete_button_Click(object sender, EventArgs e)
        {
            try
            {
                if (true)
                {
                    Hashtable ht = new Hashtable();

                    DialogResult dr = MessageBox.Show("Are you sure? ", "Question.....", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                    if (dr == DialogResult.Yes)
                    {
                        ht.Add("@payid", paymentID);

                        if (SQL_TASKS.insert_update_delete("st_deletePAYMENTS", ht) > 0)
                        {
                            CodingSourceClass.ShowMsg("Record deleted successfully from the system.", "Success");

                            enable_crud_buttons();

                            CodingSourceClass.disable_reset(left_panel);

                            LoadPayments();
                        }
                        else
                        {
                            CodingSourceClass.ShowMsg("Unable to delete.An error occured.", "Error");

                            enable_crud_buttons();

                            CodingSourceClass.disable_reset(left_panel);
                        }
                    }
                }
                else
                {
                    throw new Exception("Select a record to delete.");
                }
            }
            catch (Exception ex)
            {
                CodingSourceClass.ShowMsg(ex.Message, "Error");

                CodingSourceClass.disable_reset(left_panel); enable_crud_buttons();
            }
        }
Example #23
0
        public override void search_textBox_TextChanged(object sender, EventArgs e)
        {
            if (search_textBox.Text != "")
            {
                ListBox lb = new ListBox();

                lb.Items.Add(paymentsIDGV);     //0

                lb.Items.Add(dateGV);           //1

                lb.Items.Add(salesinvoiceIDGV); //2

                lb.Items.Add(userIDGV);         //3

                lb.Items.Add(userGV);           //4

                lb.Items.Add(billnoGV);         //5

                lb.Items.Add(customernameGV);   //6

                lb.Items.Add(customerIDGV);     //7

                lb.Items.Add(shopIDGV);         //8

                lb.Items.Add(shopGV);           //9

                lb.Items.Add(amountGV);         //10

                lb.Items.Add(ChequenoGV);       //11

                lb.Items.Add(bankGV);           //12

                lb.Items.Add(clearingdateGV);   //13

                Hashtable ht = new Hashtable();

                ht.Add("@data", search_textBox.Text);

                SQL_TASKS.load_data("st_searchPAYMENTS", payments_dataGridView, lb, ht);
            }
            else
            {
                LoadPayments();
            }
        }
Example #24
0
        public void LoadCustomers()
        {
            ListBox lb = new ListBox();

            lb.Items.Add(CustomerIDGV);

            lb.Items.Add(CustomernameGV);

            lb.Items.Add(CustomerphoneGV);

            lb.Items.Add(ShopIDGV);

            lb.Items.Add(ShopnameGV);

            lb.Items.Add(CustomeremailGV);

            SQL_TASKS.load_data("st_getCUSTOMERS", customers_dataGridView, lb);
        }
Example #25
0
        private void SALES_INVOICE_Load(object sender, EventArgs e)
        {
            try
            {
                base.edit_button.Enabled = false;

                base.edit_button.Text = "CANNOT EDIT";

                LoadSalesInvoice();

                SQL_TASKS.LoadList("st_getSHOPS", shops_comboBox_sales_invoice, "ID", "Name");

                CodingSourceClass.disable_reset(left_panel);
            }
            catch (Exception ex)
            {
                CodingSourceClass.ShowMsg(ex.Message, "Error");
            }
        }
Example #26
0
        private void load_button_ledger_Click(object sender, EventArgs e)
        {
            try
            {
                if (shop_comboBox_ledger.SelectedIndex == -1 || customers_comboBox_ledger.SelectedIndex == -1 || (complete_ledger_radioButton.Checked == false && range_radioButton.Checked == false))
                {
                    CodingSourceClass.ShowMsg("Please enter/select a record.", "Error");
                }
                else if (shop_comboBox_ledger.SelectedIndex != -1 && customers_comboBox_ledger.SelectedIndex != -1)
                {
                    Hashtable ht = new Hashtable();

                    ht.Add("@custID", Convert.ToInt32(customers_comboBox_ledger.SelectedValue.ToString()));

                    ht.Add("@shopID", Convert.ToInt32(shop_comboBox_ledger.SelectedValue.ToString()));

                    string path = Application.StartupPath + "\\Reports\\CustomerLedger.rpt";

                    if (range_radioButton.Checked == true && complete_ledger_radioButton.Checked == false)
                    {
                        ht.Add("@from", FROM_dateTimePicker.Value);

                        ht.Add("@to", TO_dateTimePicker.Value);

                        SQL_TASKS.LoadReport("st_getCUSTOMERLEDGERwrtRANGE", crystalReportViewer1, ht, rd, path);
                    }
                    else if (range_radioButton.Checked == false && complete_ledger_radioButton.Checked == true)
                    {
                        SQL_TASKS.LoadReport("st_getCUSTOMERLEDGER", crystalReportViewer1, ht, rd, path);
                    }
                }
            }
            catch (Exception ex)
            {
                CodingSourceClass.ShowMsg(ex.Message, "Error");

                if (rd != null)
                {
                    rd.Close();
                }
            }
        }
Example #27
0
        public override void delete_button_Click(object sender, EventArgs e)
        {
            try
            {
                if (shops_comboBox_sales_invoice.SelectedIndex == -1 || order_details_textBox.Text == "" || amount_textBox_sales_invoice.Text == "")
                {
                    throw new Exception("Please enter/select a record.");
                }
                else
                {
                    DialogResult dr = MessageBox.Show("SaleInvoice " + bill_no_textBox_salesinvoice.Text + "is associated with Payments,Sales Return and Vendor/Owner Ledger.\nDeleting this invoice will delete the particular data related to that invoice from Payments,Sales Return and Vendor/Owner Ledger.\nAlso particular data of Customer Leder which is associated with Payments will be deleted.\nWe recommend you to not delete this.\nAre you sure you want to delete?", "!!!WARNING!!!", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

                    if (DialogResult.Yes == dr)
                    {
                        Hashtable ht = new Hashtable();

                        ht.Add("@salesinvoiceID", salesinvoiceID);

                        if (SQL_TASKS.insert_update_delete("st_deleteSALESINVOICE", ht) > 0)
                        {
                            CodingSourceClass.ShowMsg("Record deleted successfully.", "Success");

                            CodingSourceClass.disable_reset(left_panel); enable_crud_buttons();

                            LoadSalesInvoice();
                        }
                        else
                        {
                            throw new Exception("Unabled to delete record.");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                CodingSourceClass.ShowMsg(ex.Message, "Error");

                CodingSourceClass.disable_reset(left_panel);

                enable_crud_buttons();
            }
        }
Example #28
0
        void LoadShops()
        {
            ListBox lb = new ListBox();

            lb.Items.Add(ShopIDGV);     //0

            lb.Items.Add(ShopnameGV);   //1

            lb.Items.Add(VendorIDGV);   //2

            lb.Items.Add(VendorGV);     //3

            lb.Items.Add(BranchnameGV); //4

            lb.Items.Add(ManagerIDGV);  //5

            lb.Items.Add(ManagerGV);    //6

            SQL_TASKS.load_data("st_getSHOPS", shops_dataGridView, lb);
        }
Example #29
0
        public override void search_textBox_TextChanged(object sender, EventArgs e)
        {
            if (search_textBox.Text != "")
            {
                ListBox lb = new ListBox();

                lb.Items.Add(RoleIDGV);

                lb.Items.Add(RoleGV);

                Hashtable ht = new Hashtable();

                ht.Add("@data", search_textBox.Text);

                SQL_TASKS.load_data("st_searchROLES", roles_dataGridView, lb, ht);
            }
            else
            {
                LoadRoles();
            }
        }
Example #30
0
        public override void delete_button_Click(object sender, EventArgs e)
        {
            try
            {
                if (shop_name_textBox.Text != "" || vendors_comboBox_shops.SelectedIndex != -1 || shop_branch_address_textBox.Text != "" || managers_comboBox_shops.SelectedIndex != -1)
                {
                    Hashtable ht = new Hashtable();

                    DialogResult dr = MessageBox.Show("Are you sure? ", "Question.....", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                    if (dr == DialogResult.Yes)
                    {
                        ht.Add("@id", shopID);

                        if (SQL_TASKS.insert_update_delete("st_deleteSHOPS", ht) > 0)
                        {
                            CodingSourceClass.ShowMsg("Record deleted successfully from the system.", "Success");

                            CodingSourceClass.disable_reset(left_panel);

                            enable_crud_buttons();

                            LoadShops();
                        }
                    }
                }
                else
                {
                    throw new Exception("Select a record to delete.");
                }
            }
            catch (Exception ex)
            {
                CodingSourceClass.ShowMsg(ex.Message, "Error");

                CodingSourceClass.disable_reset(left_panel);

                enable_crud_buttons();
            }
        }