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


C# DB.Execute_Queries方法代码示例

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


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

示例1: EditPanel_Delete

        private void EditPanel_Delete(object sender, EventArgs e)
        {
            try
            {
                if (Transactions_LB.SelectedIndex != -1)
                {

                    if (Message.Show("هل تريد الحذف", MessageBoxButton.YesNoCancel, 5) == MessageBoxResult.Yes)
                    {
                        DB DB1 = new DB("transactions");
                        DB1.AddCondition("trs_id", Transactions_LB.SelectedValue);
                        DB DB2 = new DB("transactions_details");
                        DB2.AddCondition("trd_trs_Id", Transactions_LB.SelectedValue);
                        DB1.Execute_Queries(DB2, DB1);
                        Fill_Transactions_LB();

                    }
                }
            }
            catch
            {

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

示例2: Add_Update

        private bool Add_Update()
        {

            try
            {

                DB db1 = new DB("persons");

                db1.AddColumn("per_name", Name_TB.Text.Trim());
                db1.AddColumn("per_address", Address_TB.Text.Trim());
                db1.AddColumn("per_phone", Telephone_TB.Text.Trim());
                db1.AddColumn("per_mobile", Mobile_TB.Text.Trim());



                DB db2 = new DB("suppliers");

                db2.AddColumn("sup_balance", Balance_TB.Text.Trim());
                

                if (LB.SelectedIndex == -1)
                {
                    db2.AddColumn("sup_per_id", db1);
                    return db2.Execute_Queries(db1, db2);
                }
                else
                {
                    db1.AddCondition("per_id", ((DataRowView)LB.SelectedItem)["per_id"]);
                    db2.AddCondition("sup_id", LB.SelectedValue);
                    
                    
                    return db2.Execute_Queries(db1, db2);
                }


            }
            catch
            {
                return false;
            }
        }
开发者ID:Enumeg,项目名称:POS-General,代码行数:41,代码来源:Suppliers.xaml.cs

示例3: Add_Update

        private bool Add_Update()
        {
            try
            {
                DB DB1 = new DB("transactions");

                DB1.AddColumn("trs_no", No_TB.Text.Trim());
                DB1.AddColumn("trs_trn_id", Transaction);
                DB1.AddColumn("trs_id_1", Var1_CB.SelectedValue, Var1_CB.SelectedValue == null);
                DB1.AddColumn("trs_id_2", Var2_CB.SelectedValue, Var2_CB.SelectedValue == null);
                DB1.AddColumn("trs_date", Date_DTP.Value.Value.Date);
                DB1.AddColumn("trs_total", Total_TB.Text.Trim());
                DB1.AddColumn("trs_paid", Paid_TB.Text.Trim());

                DB DB2 = new DB("transactions_details");
                DB2.Table = new DataTable();
                DB2.Table.Columns.Add("trd_trs_id", typeof(DB));
                DB2.Table.Columns.Add("trd_pro_id");
                DB2.Table.Columns.Add("trd_amount");
                DB2.Table.Columns.Add("trd_price");
                foreach (DataRow row in Transactions_Details.Rows)
                {
                    DB2.Table.Rows.Add(DB1, row["trd_pro_id"], row["trd_amount"], row["trd_price"]);
                }
                if (Transactions_LB.SelectedValue == null)
                {
                    if (DB1.IsNotExist("trs_id", "trs_no", "trs_trn_id", "trs_id_1", "trs_id_2"))
                    {
                        return DB1.Execute_Queries(DB1, DB2);
                    }
                    else
                    {
                        Message.Show("لقد تم التسجيل من قبل", MessageBoxButton.OK, 5);
                        return false;
                    }
                }
                else
                {
                    DB1.Last_Inserted = Transactions_LB.SelectedValue;
                    DB DB3 = new DB("transactions_details");
                    DB1.AddCondition("trs_Id", Transactions_LB.SelectedValue);
                    DB3.AddCondition("trd_trs_Id", Transactions_LB.SelectedValue);
                    return DB1.Execute_Queries(DB3, DB1, DB2);
                }

            }
            catch
            {
                return false;
            }
        }
开发者ID:Enumeg,项目名称:POS-General,代码行数:51,代码来源:Transactions.xaml.cs

示例4: Add_Update

        public bool Add_Update()
        {

            try
            {

                DB db1 = new DB("persons");

                db1.AddColumn("per_name", Name_TB.Text.Trim());
                db1.AddColumn("per_address", Address_TB.Text.Trim());
                db1.AddColumn("per_phone", Telephone_TB.Text.Trim());
                db1.AddColumn("per_mobile", Mobile_TB.Text.Trim());



                DB db2 = new DB("employees");

                db2.AddColumn("emp_job_id", Job_CB.SelectedValue);
                db2.AddColumn("emp_salary", Salary_TB.Text.Trim());


                if(LB.SelectedIndex == -1)
                {
                    db2.AddColumn("emp_per_id", db1);
                    return db2.Execute_Queries(db1, db2);
                }
                else
                {
                    db1.AddCondition("per_id", ((DataRowView)LB.SelectedItem)["per_id"]);
                    db2.AddCondition("emp_id", LB.SelectedValue);


                    return db2.Execute_Queries(db1, db2);
                }


            }
            catch
            {
                return false;
            }
        }
开发者ID:Enumeg,项目名称:POS-General,代码行数:42,代码来源:Employees.xaml.cs


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