当前位置: 首页>>代码示例>>C#>>正文


C# DB.Fill方法代码示例

本文整理汇总了C#中DB.Fill方法的典型用法代码示例。如果您正苦于以下问题:C# DB.Fill方法的具体用法?C# DB.Fill怎么用?C# DB.Fill使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DB的用法示例。


在下文中一共展示了DB.Fill方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Fill_Customers_LB

        private void Fill_Customers_LB()
        {

            try
            {
                DB db2 = new DB();

                // search by name
                db2.AddCondition("per_name", "%" + Name_Search_TB.Text + "%", false, " like ");

                // search by mobile
                db2.AddCondition("per_mobile", "%" + Mobile_Search_TB.Text + "%", false, " like ");
                if(Table == "customers")
                {
                    db2.Fill(LB, "cus_id", "per_name", @"select * from customers sup join persons per on sup.cus_per_id=per.per_id");
                }
                else
                {
                    db2.Fill(LB, "sup_id", "per_name", @"select *,sup_balance cus_balance from suppliers sup join persons per on sup.sup_per_id=per.per_id");
                }
            }
            catch
            {

            }

        }
开发者ID:Enumeg,项目名称:POS-General,代码行数:27,代码来源:Customers.xaml.cs

示例2: Fill_Employees_LB

        private void Fill_Employees_LB()
        {

            try
            {
                DB db2 = new DB("employees");

                // search by name
                db2.AddCondition("per_name", "%" + Name_Search_TB.Text + "%", false, " like ");

                // search by mobile
                db2.AddCondition("per_phone", "%" + Mobile_Search_TB.Text + "%", false, " like ");

                // search by Job
                db2.AddCondition("emp_job_id", Job_Search_CB.SelectedValue, Job_Search_CB.SelectedIndex < 1, "=", "emp_job_id");



                db2.Fill(LB, "emp_id", "per_name", @"select * from employees e join persons p on p.per_id=e.emp_per_id join jobs j on j.job_id=e.emp_job_id");

            }
            catch
            {

            }

        }
开发者ID:Enumeg,项目名称:POS-General,代码行数:27,代码来源:Employees.xaml.cs

示例3: Get_All_Categories

        public static void Get_All_Categories(ComboBox CB, string All = "")
        {
            try
            {
                DB db = new DB("Categories");
                db.SelectedColumns.Add("*");
                db.Fill(CB, "cat_id", "cat_name", "", All);
            }
            catch
            {

            }
        }
开发者ID:Enumeg,项目名称:POS-General,代码行数:13,代码来源:Categories.xaml.cs

示例4: Get_All_Properties

        public static void Get_All_Properties(ComboBox CB, string All = "")
        {
            try
            {
                DB db = new DB("Properties");
                db.SelectedColumns.Add("*");
                db.Fill(CB, "prp_id", "prp_name", "", All);
            }
            catch
            {

            }
        }
开发者ID:Enumeg,项目名称:POS-General,代码行数:13,代码来源:Properties.xaml.cs

示例5: Fill_Products_LB

        private void Fill_Products_LB()
        {
            try
            {
                int i = 2;               
                DB db2 = new DB();

                db2.AddCondition("pro_name", Product_TB.Text, false, " like ");
                db2.AddCondition("pro_cat_id", Categories_CB.SelectedValue, Categories_CB.SelectedIndex < 1);

                db2.Fill(Products_LB, "pro_id", "pro_name", "select pro_id,pro_name from products");
            }
            catch
            {

            }

        }
开发者ID:Enumeg,项目名称:POS-General,代码行数:18,代码来源:Products_Search.xaml.cs

示例6: Get_All_OutCome_Types

        public static void Get_All_OutCome_Types(ComboBox CB, string All = "")
        {
            try
            {
                DB db2 = new DB("outcome_types");

                db2.Fill(CB, "ott_id", "ott_name", "select * from outcome_types", All);

            }
            catch
            {

            }
        }
开发者ID:Enumeg,项目名称:POS-General,代码行数:14,代码来源:OutCome_Types.xaml.cs

示例7: Get_All_Jobs

        public static void Get_All_Jobs(ComboBox CB, string All = "")
        {
            try
            {
                DB db2 = new DB("jobs");

                db2.Fill(CB, "job_id", "job_name", "select * from jobs", All);

            }
            catch
            {

            }
        }
开发者ID:Enumeg,项目名称:POS-General,代码行数:14,代码来源:jobs.xaml.cs

示例8: Fill_Groups_LB

        private void Fill_Groups_LB()
        {
            try
            {
                DB db = new DB("groups");
                db.AddCondition("grp_name", Type_TB.Text.Trim(), false, " like ");
                db.SelectedColumns.Add("*");
                db.Fill(LB, "grp_id", "grp_name");
            }
            catch
            {

            }
        }
开发者ID:Enumeg,项目名称:POS-General,代码行数:14,代码来源:Groups.xaml.cs

示例9: Fill_Categories_LB

        private void Fill_Categories_LB()
        {
            try
            {
                DB db = new DB("Categories");
                db.AddCondition("cat_name", Category_TB.Text.Trim(), false, " like ");
                db.SelectedColumns.Add("*");
                db.Fill(LB, "cat_id", "cat_name");
            }
            catch
            {

            }
        }
开发者ID:Enumeg,项目名称:POS-General,代码行数:14,代码来源:Categories.xaml.cs

示例10: Fill_Point_LB

        private void Fill_Point_LB()
        {
            try
            {
                DB db = new DB("points");
                db.AddCondition("pon_name", Point_TB.Text.Trim(), false, " like ");
                db.AddCondition("pon_type", Type_CB.SelectedIndex - 1, Type_CB.SelectedIndex < 1);
                db.SelectedColumns.Add("*");
                db.Fill(Points_LB, "pon_id", "pon_name");
            }
            catch
            {

            }
        }
开发者ID:Enumeg,项目名称:POS-General,代码行数:15,代码来源:Points.xaml.cs

示例11: Fill_Properties_LB

        private void Fill_Properties_LB()
        {
            try
            {
                DB db = new DB("Properties");
                db.AddCondition("prp_name", Property_TB.Text.Trim(), false, " like ");
                db.AddCondition("prp_cat_id", Categories_CB.SelectedValue, Categories_CB.SelectedIndex < 1);
                db.SelectedColumns.Add("*");
                db.Fill(LB, "prp_id", "prp_name");
            }
            catch
            {

            }
        }
开发者ID:Enumeg,项目名称:POS-General,代码行数:15,代码来源:Properties.xaml.cs

示例12: Get_All_Products

        public static void Get_All_Products(ComboBox CB, string All = "")
        {

            try
            {
                DB db2 = new DB();

                db2.Fill(CB, "pro_id", "pro_name", "select * from products", All);
            }

            catch
            {

            }


        }
开发者ID:Enumeg,项目名称:POS-General,代码行数:17,代码来源:Products.xaml.cs

示例13: Get_All_Suppliers

        public static void Get_All_Suppliers(ComboBox CB,string All = "")
        {

            try
            {
                DB db2 = new DB("suppliers");


                db2.Fill(CB, "per_id", "per_name", "select per_id,per_name from suppliers sup join persons per on sup.sup_per_id=per.per_id", All);
            }

            catch
            {

            }


        }
开发者ID:Enumeg,项目名称:POS-General,代码行数:18,代码来源:Suppliers.xaml.cs

示例14: Get_All_employees

        public static void Get_All_employees(ComboBox CB, int job = 0, string All = "")
        {

            try
            {
                DB db2 = new DB("employees");

                db2.AddCondition("emp_job_id", job, job == 0);

                db2.Fill(CB, "emp_id", "per_name", "select emp_id,per_name from employees e join persons p on p.per_id=e.emp_per_id join jobs j on j.job_id=e.emp_job_id", All);
            }

            catch
            {

            }


        }
开发者ID:Enumeg,项目名称:POS-General,代码行数:19,代码来源:Employees.xaml.cs

示例15: Fill_Jobs_LB

        private void Fill_Jobs_LB()
        {

            try
            {
                DB db2 = new DB("jobs");

                // search by name
                db2.AddCondition("job_name", "%" + Name_TB.Text + "%", false, " like ");

                db2.Fill(LB, "job_id", "job_name", "select * from jobs");


            }
            catch
            {

            }
        }
开发者ID:Enumeg,项目名称:POS-General,代码行数:19,代码来源:jobs.xaml.cs


注:本文中的DB.Fill方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。