public static int GetCount(string Key_For)
        {
            int    val   = 0;
            string query = "";

            switch (Key_For)
            {
            case ConfigSelectQueryModes.NO_OF_INVOICES:
                query = ConfigSelectQueries.INVOICE_COUNT;
                query = query.Replace("V_INVOICE_NO", OBJ_Stock.INVOICE_NO);
                query = query.Replace("V_C_CODE", OBJ_Stock.COMPANY_CODE.ToString());
                break;

            case ConfigSelectQueryModes.NO_OF_BATCHS:
                query = ConfigSelectQueries.BATCHS_COUNT;
                query = query.Replace("V_BATCH_NO", OBJ_Stock.BATCH_NO);
                query = query.Replace("V_C_CODE", OBJ_Stock.COMPANY_CODE.ToString());
                break;
            }
            DataTable datatable = RunSelectQueries.Select(query);

            try
            {
                val = Convert.ToInt32(datatable.Rows[0]["NO"].ToString());
            }
            catch (Exception)
            {
            }
            return(val);
        }
        public static int GetID(string Key_For)
        {
            int    val   = 0;
            string query = "";

            switch (Key_For)
            {
            case ConfigFormNames.ZONE_NEW:
                query = ConfigSelectQueries.MAX_ZONE;
                break;

            case ConfigFormNames.COMPANY:
                query = ConfigSelectQueries.MAX_COMPANY;
                break;

            case ConfigFormNames.CITY_NEW:
                query = ConfigSelectQueries.MAX_CITY;
                break;

            case ConfigFormNames.CUSTOMER_NEW:
                query = ConfigSelectQueries.MAX_CUSTOMER;
                break;

            case ConfigFormNames.SALES_MAN_NEW:
                query = ConfigSelectQueries.MAX_SALES_MAN;
                break;

            case ConfigFormNames.PRODUCT_NEW:
                query = ConfigSelectQueries.MAX_PRODUCT;
                break;

            case ConfigFormNames.STOCK_NEW:
                query = ConfigSelectQueries.MAX_STOCK;
                break;

            case ConfigFormNames.SALES:
                query = ConfigSelectQueries.MAX_SALE;
                break;

            case ConfigSelectQueryModes.MAX_INVOICE:
                query = ConfigSelectQueries.MAX_INVOICE;
                break;
            }
            DataTable datatable = RunSelectQueries.Select(query);

            try
            {
                val = Convert.ToInt32(datatable.Rows[0]["max"].ToString());
            }
            catch (Exception)
            {
            }

            return(val + 1);
        }
        public static void Set(ComboBox comboBox, string ID_For)
        {
            DataTable dataTable = new DataTable();

            switch (ID_For)
            {
            case ConfigFormNames.CITY_NEW:
            {
                dataTable = RunSelectQueries.Select(ConfigSelectQueries.ALL_ZONE_FOR_COMBOBOX);
                comboBox.DisplayMember = "ZName";
                comboBox.ValueMember   = "Code";
                comboBox.DataSource    = dataTable;
            }
            break;

            case ConfigFormNames.PRODUCT_NEW:
            {
                dataTable = RunSelectQueries.Select(ConfigSelectQueries.ALL_MEDICINE_TYPE);
                comboBox.DisplayMember = "Name";
                comboBox.ValueMember   = "Code";
                comboBox.DataSource    = dataTable;
            }
            break;

            case ConfigSelectQueries.DISCOUNT_MODE:
            {
                dataTable = RunSelectQueries.Select(ConfigSelectQueries.ALL_DISCOUNT_MODE);
                comboBox.DisplayMember = "Name";
                comboBox.ValueMember   = "Code";
                comboBox.DataSource    = dataTable;
            }
            break;

            case ConfigSelectQueries.SALES_TAX_MODE:
            {
                dataTable = RunSelectQueries.Select(ConfigSelectQueries.ALL_SALES_TAX_MODE);
                comboBox.DisplayMember = "Name";
                comboBox.ValueMember   = "Code";
                comboBox.DataSource    = dataTable;
            }
            break;

            case ConfigSelectQueries.GROUPS_LOAD:
            {
                dataTable = RunSelectQueries.Select(ConfigSelectQueries.ALL_GROUPS);
                comboBox.DisplayMember = "Name";
                comboBox.ValueMember   = "Code";
                comboBox.DataSource    = dataTable;
            }
            break;
            }
        }
示例#4
0
        public static DataTable GetDataTableWhere(string Mode)
        {
            string Query = "";

            switch (Mode)
            {
            case ConfigSelectQueryModes.CURRENT_INVOICE_MODE:
            {
                Query = ConfigSelectQueries.CURRENT_INVOICE;
                Query = Query.Replace("V_INVOICE_NO", OBJ_Stock.INVOICE_NO);
            }
            break;

            case ConfigSelectQueryModes.CURRENT_SALE_INVOICE_MODE:
            {
                Query = ConfigSelectQueries.CURRENT_SALE_INVOICE;
                Query = Query.Replace("V_INVOICE_NO", OBJ_Sales.INVOICE_NO.ToString());
            }
            break;
            }
            return(RunSelectQueries.Select(Query));
        }
示例#5
0
 public static DataTable GetDataTable(string Query)
 {
     return(RunSelectQueries.Select(Query));
 }