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


C# DBConnectionControl40.SQL_Parameter类代码示例

本文整理汇总了C#中DBConnectionControl40.SQL_Parameter的典型用法代码示例。如果您正苦于以下问题:C# SQL_Parameter类的具体用法?C# SQL_Parameter怎么用?C# SQL_Parameter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: Get

 internal static bool Get(string_v country_v, ref long_v cState_Person_ID_v)
 {
     if (country_v != null)
     {
         List<SQL_Parameter> lpar = new List<SQL_Parameter>();
         string spar = "@par";
         SQL_Parameter par = new SQL_Parameter(spar, SQL_Parameter.eSQL_Parameter.Nvarchar, false, country_v.v);
         lpar.Add(par);
         string sql = @"select ID from cState_Person where State = @par";
         DataTable dt = new DataTable();
         string Err = null;
         if (DBSync.DBSync.ReadDataTable(ref dt, sql, lpar, ref Err))
         {
             if (dt.Rows.Count > 0)
             {
                 if (cState_Person_ID_v == null)
                 {
                     cState_Person_ID_v = new long_v();
                 }
                 cState_Person_ID_v.v = (long)dt.Rows[0]["ID"];
                 return true;
             }
             else
             {
                 sql = @"insert into cState_Person (State) values (@par)";
                 long cState_Person_ID = -1;
                 object oret = null;
                 if (DBSync.DBSync.ExecuteNonQuerySQLReturnID(sql, lpar, ref cState_Person_ID, ref oret, ref Err, "cState_Person"))
                 {
                     if (cState_Person_ID_v == null)
                     {
                         cState_Person_ID_v = new long_v();
                     }
                     cState_Person_ID_v.v = cState_Person_ID;
                     return true;
                 }
                 else
                 {
                     LogFile.Error.Show("ERROR:TangentaDB:f_cState_Person:Get(string_v country_v, ref long_v atom_cState_Person_ID_v) sql=" + sql + "\r\nErr=" + Err);
                     return false;
                 }
             }
         }
         else
         {
             LogFile.Error.Show("ERROR:TangentaDB:f_cState_Person:Get(string_v country_v, ref long_v atom_cState_Person_ID_v) sql=" + sql + "\r\nErr=" + Err);
             return false;
         }
     }
     else
     {
         cState_Person_ID_v = null;
         return true;
     }
 }
开发者ID:dstrucl,项目名称:Tangenta40,代码行数:55,代码来源:f_cState_Person.cs

示例2: Get

 internal static bool Get(string_v OrgTYPE_v, ref long_v cOrgTYPE_ID_v)
 {
     if (OrgTYPE_v != null)
     {
         List<SQL_Parameter> lpar = new List<SQL_Parameter>();
         string spar = "@par";
         SQL_Parameter par = new SQL_Parameter(spar, SQL_Parameter.eSQL_Parameter.Nvarchar, false, OrgTYPE_v.v);
         lpar.Add(par);
         string sql = @"select ID from cOrgTYPE where OrganisationTYPE = @par";
         DataTable dt = new DataTable();
         string Err = null;
         if (DBSync.DBSync.ReadDataTable(ref dt, sql, lpar, ref Err))
         {
             if (dt.Rows.Count > 0)
             {
                 if (cOrgTYPE_ID_v == null)
                 {
                     cOrgTYPE_ID_v = new long_v();
                 }
                 cOrgTYPE_ID_v.v = (long)dt.Rows[0]["ID"];
                 return true;
             }
             else
             {
                 sql = @"insert into cOrgTYPE (OrganisationTYPE) values (@par)";
                 long cOrgTYPE_ID = -1;
                 object oret = null;
                 if (DBSync.DBSync.ExecuteNonQuerySQLReturnID(sql, lpar, ref cOrgTYPE_ID, ref oret, ref Err, "cOrgTYPE"))
                 {
                     if (cOrgTYPE_ID_v == null)
                     {
                         cOrgTYPE_ID_v = new long_v();
                     }
                     cOrgTYPE_ID_v.v = cOrgTYPE_ID;
                     return true;
                 }
                 else
                 {
                     LogFile.Error.Show("ERROR:TangentaDB:f_cOrgTYPE:Get(string_v OrgTYPE_v, ref long_v cOrgTYPE_ID_v) sql=" + sql + "\r\nErr=" + Err);
                     return false;
                 }
             }
         }
         else
         {
             LogFile.Error.Show("ERROR:TangentaDB:f_cOrgTYPE:Get(string_v OrgTYPE_v, ref long_v cOrgTYPE_ID_v) sql=" + sql + "\r\nErr=" + Err);
             return false;
         }
     }
     else
     {
         LogFile.Error.Show("ERROR:TangentaDB:f_cOrgTYPE:Get(string_v OrgTYPE_v, ref long_v cOrgTYPE_ID_v) OrgTYPE_v may not be null!");
         return false;
     }
 }
开发者ID:dstrucl,项目名称:Tangenta40,代码行数:55,代码来源:f_cOrgTYPE.cs

示例3: Get

        public static bool Get(string Country,
            string Country_ISO_3166_a2,
            string Country_ISO_3166_a3,
            short Country_ISO_3166_num,
            ref long cCountry_Person_ID)
        {
            List<SQL_Parameter> lpar = new List<SQL_Parameter>();

            string spar_Country = "@par_Country";
            SQL_Parameter par_Country = new SQL_Parameter(spar_Country, SQL_Parameter.eSQL_Parameter.Nvarchar, false, Country);
            lpar.Add(par_Country);

            string spar_Country_ISO_3166_a2 = "@par_Country_ISO_3166_a2";
            SQL_Parameter par_Country_ISO_3166_a2 = new SQL_Parameter(spar_Country_ISO_3166_a2, SQL_Parameter.eSQL_Parameter.Nvarchar, false, Country_ISO_3166_a2);
            lpar.Add(par_Country_ISO_3166_a2);

            string spar_Country_ISO_3166_a3 = "@par_Country_ISO_3166_a3";
            SQL_Parameter par_Country_ISO_3166_a3 = new SQL_Parameter(spar_Country_ISO_3166_a3, SQL_Parameter.eSQL_Parameter.Nvarchar, false, Country_ISO_3166_a3);
            lpar.Add(par_Country_ISO_3166_a3);

            string spar_Country_ISO_3166_num = "@par_Country_ISO_3166_num";
            SQL_Parameter par_Country_ISO_3166_num = new SQL_Parameter(spar_Country_ISO_3166_num, SQL_Parameter.eSQL_Parameter.Smallint, false, Country_ISO_3166_num);
            lpar.Add(par_Country_ISO_3166_num);

            string Err = null;
            DataTable dt = new DataTable();
            string sql = @"select ID from cCountry_Person where Country= " + spar_Country + " and  Country_ISO_3166_a2 = " + spar_Country_ISO_3166_a2 + " and Country_ISO_3166_a3 = " + spar_Country_ISO_3166_a3 + " and Country_ISO_3166_num = " + spar_Country_ISO_3166_num;
            if (DBSync.DBSync.ReadDataTable(ref dt, sql, lpar, ref Err))
            {
                if (dt.Rows.Count > 0)
                {
                    cCountry_Person_ID = (long)dt.Rows[0]["ID"];
                    return true;
                }
                else
                {
                    sql = @"insert into cCountry_Person (Country,Country_ISO_3166_a2,Country_ISO_3166_a3,Country_ISO_3166_num) values (" + spar_Country + "," + spar_Country_ISO_3166_a2 + "," + spar_Country_ISO_3166_a3 + "," + spar_Country_ISO_3166_num + ")";
                    object objretx = null;
                    if (DBSync.DBSync.ExecuteNonQuerySQLReturnID(sql, lpar, ref cCountry_Person_ID, ref objretx, ref Err, "cCountry_Person"))
                    {
                        return true;
                    }
                    else
                    {
                        LogFile.Error.Show("ERROR:f_cCountry_Person:Get:sql=" + sql + "\r\nErr=" + Err);
                        return false;
                    }
                }
            }
            else
            {
                LogFile.Error.Show("ERROR:f_cCountry_Person:Get:sql=" + sql + "\r\nErr=" + Err);
                return false;
            }
        }
开发者ID:dstrucl,项目名称:Tangenta40,代码行数:55,代码来源:f_cCountry_Person.cs

示例4: Get

        public static bool Get(string Abbreviation,string Name,string Symbol,int CurrencyCode, int DecimalPlaces, ref long Currency_ID)
        {
            List<SQL_Parameter> lpar = new List<SQL_Parameter>();

            string spar_Abbreviation = "@par_Abbreviation";
            SQL_Parameter par_Abbreviation = new SQL_Parameter(spar_Abbreviation, SQL_Parameter.eSQL_Parameter.Nvarchar, false, Abbreviation);
            lpar.Add(par_Abbreviation);

            string spar_Name = "@par_Name";
            SQL_Parameter par_Name = new SQL_Parameter(spar_Name, SQL_Parameter.eSQL_Parameter.Nvarchar, false, Name);
            lpar.Add(par_Name);

            string spar_Symbol = "@par_Symbol";
            SQL_Parameter par_Symbol = new SQL_Parameter(spar_Symbol, SQL_Parameter.eSQL_Parameter.Nvarchar, false, Symbol);
            lpar.Add(par_Symbol);

            string spar_CurrencyCode = "@par_CurrencyCode";
            SQL_Parameter par_CurrencyCode = new SQL_Parameter(spar_CurrencyCode, SQL_Parameter.eSQL_Parameter.Int, false, CurrencyCode);
            lpar.Add(par_CurrencyCode);

            string spar_DecimalPlaces = "@par_DecimalPlaces";
            SQL_Parameter par_DecimalPlaces = new SQL_Parameter(spar_DecimalPlaces, SQL_Parameter.eSQL_Parameter.Int, false, DecimalPlaces);
            lpar.Add(par_DecimalPlaces);

            string sql = "select ID from Currency where Abbreviation = "+ spar_Abbreviation + " and  Name = " + spar_Name + " and CurrencyCode = " + spar_CurrencyCode + " and DecimalPlaces = " + spar_DecimalPlaces;
            DataTable dt = new DataTable();
            string Err = null;
            if (DBSync.DBSync.ReadDataTable(ref dt, sql, lpar, ref Err))
            {
                if (dt.Rows.Count > 0)
                {
                    Currency_ID = (long)dt.Rows[0]["ID"];
                    return true;
                }
                else
                {
                    sql = "insert into Currency (Abbreviation,Name,Symbol,CurrencyCode,DecimalPlaces)values(" + spar_Abbreviation + "," + spar_Name + "," + spar_Symbol+ "," + spar_CurrencyCode + "," + spar_DecimalPlaces + ")";
                    object oret = null;
                    if (DBSync.DBSync.ExecuteNonQuerySQLReturnID(sql, lpar, ref Currency_ID, ref oret, ref Err, "Currency"))
                    {
                        return true;
                    }
                    else
                    {
                        LogFile.Error.Show("ERROR:f_Currency:InsertDefault:sql=" + sql + "\r\nErr=" + Err);
                        return false;
                    }
                }
            }
            else
            {
                LogFile.Error.Show("ERROR:f_Currency:Get:sql=" + sql + "\r\nErr=" + Err);
                return false;
            }
        }
开发者ID:dstrucl,项目名称:Tangenta40,代码行数:55,代码来源:f_Currency.cs

示例5: Get_journal_docinvoice_type_id

        public static bool Get_journal_docinvoice_type_id(string Event_Type, string Event_Description, ref long journal_invoice_type_id)
        {
            List<SQL_Parameter> lpar = new List<SQL_Parameter>();
            string spar_Name = "@par_Name";
            string spar_Description = "@par_Description";
            SQL_Parameter par_Name = new SQL_Parameter(spar_Name, SQL_Parameter.eSQL_Parameter.Nvarchar, false, Event_Type);
            lpar.Add(par_Name);

            string par_Description_cond = null;
            string par_Description_value = null;
            if (Event_Description != null)
            {
                par_Description_cond = " Description = " + spar_Description;
                par_Description_value = spar_Description;
            }
            else
            {
                par_Description_cond = " Description is null ";
                par_Description_value = "null";
            }

            SQL_Parameter par_Description = new SQL_Parameter(spar_Description, SQL_Parameter.eSQL_Parameter.Nvarchar, false, Event_Description);
            lpar.Add(par_Description);

            string Err = null;
            string sql = "select ID from journal_docinvoice_type where name = " + spar_Name + " and " + par_Description_cond;
            DataTable dt = new DataTable();
            if (DBSync.DBSync.ReadDataTable(ref dt, sql, lpar, ref Err))
            {
                if (dt.Rows.Count > 0)
                {
                    journal_invoice_type_id = (long)dt.Rows[0]["ID"];
                    return true;
                }
                else
                {
                    sql = "insert into journal_docinvoice_type (Name,Description) values (" + spar_Name + "," + par_Description_value + ")";
                    object ores = null;
                    if (DBSync.DBSync.ExecuteNonQuerySQLReturnID(sql, lpar, ref journal_invoice_type_id, ref ores, ref Err, "journal_docinvoice_type"))
                    {
                        return true;
                    }
                    else
                    {
                        LogFile.Error.Show("ERROR:f_Journal_DocInvoice:Get_journal_docinvoice_type_id:sql = " + sql + "\r\nErr=" + Err);
                        return false;
                    }
                }
            }
            else
            {
                LogFile.Error.Show("ERROR:f_Journal_DocInvoice:Get_journal_docinvoice_type_id:sql = " + sql + "\r\nErr=" + Err);
                return false;
            }
        }
开发者ID:dstrucl,项目名称:Tangenta40,代码行数:55,代码来源:f_Journal_DocInvoice.cs

示例6: Add

        public static bool Add(long StockTake_ID, string Name, decimal Cost, string Description, ref long StockTake_AdditionalCost_ID)
        {
            string Err = null;
            List<SQL_Parameter> lpar = new List<SQL_Parameter>();
            long StocTakeCostName_ID = -1;
            if (f_StockTakeCostName.Get(Name, ref StocTakeCostName_ID))
            {
                string spar_StocTakeCostDescription_ID = "null";
                if (Description != null)
                {
                    if (Description.Length > 0)
                    {
                        long StocTakeCostDescription_ID = -1;
                        if (f_StockTakeCostDescription.Get(Description, ref StocTakeCostDescription_ID))
                        {
                            spar_StocTakeCostDescription_ID = "@par_StocTakeCostDescription_ID";
                            SQL_Parameter par_StocTakeCostDescription_ID = new SQL_Parameter(spar_StocTakeCostDescription_ID, SQL_Parameter.eSQL_Parameter.Bigint, false, StocTakeCostName_ID);
                            lpar.Add(par_StocTakeCostDescription_ID);
                        }
                    }
                }

                string spar_StocTakeCostName_ID = "@par_StocTakeCostName_ID";
                SQL_Parameter par_StocTakeCostName_ID = new SQL_Parameter(spar_StocTakeCostName_ID, SQL_Parameter.eSQL_Parameter.Bigint, false, StocTakeCostName_ID);
                lpar.Add(par_StocTakeCostName_ID);

                string spar_Cost = "@par_Cost";
                SQL_Parameter par_Cost = new SQL_Parameter(spar_Cost, SQL_Parameter.eSQL_Parameter.Decimal, false, Cost);
                lpar.Add(par_Cost);

                string spar_StocTake_ID = "@par_StocTake_ID";
                SQL_Parameter par_StocTake_ID = new SQL_Parameter(spar_StocTake_ID, SQL_Parameter.eSQL_Parameter.Bigint, false, StockTake_ID);
                lpar.Add(par_StocTake_ID);

                string sql = "insert into StockTake_AdditionalCost (StockTakeCostName_ID,Cost,StockTakeCostDescription_ID,StockTake_ID)values("
                              + spar_StocTakeCostName_ID + ","
                              + spar_Cost + ","
                              + spar_StocTakeCostDescription_ID + ","
                              + spar_StocTake_ID
                              + ")";
                object oret = null;
                if (DBSync.DBSync.ExecuteNonQuerySQLReturnID(sql, lpar, ref StockTake_AdditionalCost_ID, ref oret, ref Err, "StockTake_AdditionalCost"))
                {
                    return true;
                }
                else
                {
                    LogFile.Error.Show("ERROR:TangentaDB:f_StockTake_AdditionalCost.cs:Add:sql=" + sql + "\r\nErr=" + Err);
                }
            }
            return false;
        }
开发者ID:dstrucl,项目名称:Tangenta40,代码行数:52,代码来源:f_StockTake_AdditionalCost.cs

示例7: Get

 public static bool Get(string_v FirstName_v, ref long cFirstName_ID)
 {
     string Err = null;
     string sql = null;
     List<SQL_Parameter> lpar = new List<SQL_Parameter>();
     string scond_FirstName = null;
     string sval_FirstName = "null";
     if (FirstName_v != null)
     {
         string spar_FirstName = "@par_FirstName";
         SQL_Parameter par_FirstName = new SQL_Parameter(spar_FirstName, SQL_Parameter.eSQL_Parameter.Nvarchar, false, FirstName_v.v);
         lpar.Add(par_FirstName);
         scond_FirstName = "FirstName = " + spar_FirstName;
         sval_FirstName = spar_FirstName;
     }
     else
     {
         scond_FirstName = "FirstName is null";
         sval_FirstName = "null";
     }
     DataTable dt = new DataTable();
     dt.Columns.Clear();
     dt.Clear();
     sql = @"select ID from cFirstName where " + scond_FirstName;
     if (DBSync.DBSync.ReadDataTable(ref dt, sql, lpar, ref Err))
     {
         if (dt.Rows.Count > 0)
         {
            cFirstName_ID = (long)dt.Rows[0]["ID"];
            return true;
         }
         else
         {
             sql = @"insert into cFirstName (FirstName) values (" + sval_FirstName + ")";
             object objretx = null;
             if (DBSync.DBSync.ExecuteNonQuerySQLReturnID(sql, lpar, ref cFirstName_ID, ref objretx, ref Err, "cFirstName"))
             {
                 return true;
             }
             else
             {
                 LogFile.Error.Show("ERROR:f_cFirstName:Get:sql=" + sql + "\r\nErr=" + Err);
                 return false;
             }
         }
     }
     else
     {
         LogFile.Error.Show("ERROR:f_cFirstName:Get:sql=" + sql + "\r\nErr=" + Err);
         return false;
     }
 }
开发者ID:dstrucl,项目名称:Tangenta40,代码行数:52,代码来源:f_cFirstName.cs

示例8: Get

 public static bool Get(string City, ref long cCity_Org_ID)
 {
     List<SQL_Parameter> lpar = new List<SQL_Parameter>();
     string scond_City = null;
     string sval_City = "null";
     if (City != null)
     {
         string spar_City = "@par_City";
         SQL_Parameter par_City = new SQL_Parameter(spar_City, SQL_Parameter.eSQL_Parameter.Nvarchar, false, City);
         lpar.Add(par_City);
         scond_City = "City = " + spar_City;
         sval_City = spar_City;
     }
     else
     {
         scond_City = "City is null";
         sval_City = "null";
     }
     DataTable dt = new DataTable();
     string Err = null;
     dt.Columns.Clear();
     dt.Clear();
     string sql = @"select ID from cCity_Org where " + scond_City;
     if (DBSync.DBSync.ReadDataTable(ref dt, sql, lpar, ref Err))
     {
         if (dt.Rows.Count > 0)
         {
             cCity_Org_ID = (long)dt.Rows[0]["ID"];
             return true;
         }
         else
         {
             sql = @"insert into cCity_Org (City) values (" + sval_City + ")";
             object objretx = null;
             if (DBSync.DBSync.ExecuteNonQuerySQLReturnID(sql, lpar, ref cCity_Org_ID, ref objretx, ref Err, "Atom_cCity_Org"))
             {
                 return true;
             }
             else
             {
                 LogFile.Error.Show("ERROR:f_cCity_Org:Get:sql=" + sql + "\r\nErr=" + Err);
                 return false;
             }
         }
     }
     else
     {
         LogFile.Error.Show("ERROR:f_cCity_Org:Get:sql=" + sql + "\r\nErr=" + Err);
         return false;
     }
 }
开发者ID:dstrucl,项目名称:Tangenta40,代码行数:51,代码来源:f_cCity_Org.cs

示例9: Get

        internal static bool Get(string Name, string Description, ref long JOURNAL_Invoice_type_ID)
        {
            string Err = null;
            DataTable dt = new DataTable();
            string sql = null;

            sql = @"select ID from JOURNAL_Invoice_Type where Name = '" + Name + "'";
            if (Program.LocalDB_for_Tangenta.m_DBTables.m_con.ReadDataTable(ref dt, sql, null, ref Err))
            {
                if (dt.Rows.Count > 0)
                {
                    JOURNAL_Invoice_type_ID = (long)dt.Rows[0]["ID"];
                    return true;
                }
                else
                {

                    List<SQL_Parameter> lpar = new List<SQL_Parameter>();
                    string sPar_Description = "@Description";
                    if (Description != null)
                    {
                        SQL_Parameter par_Description = new SQL_Parameter(sPar_Description, SQL_Parameter.eSQL_Parameter.Nvarchar, false, sPar_Description);
                        lpar.Add(par_Description);
                    }
                    else
                    {
                        sPar_Description = "null";
                    }
                    string sPar_Name = "@Name";
                    SQL_Parameter par_Name = new SQL_Parameter(sPar_Name, SQL_Parameter.eSQL_Parameter.Nvarchar, false, sPar_Name);
                    lpar.Add(par_Name);

                    sql = @"insert into JOURNAL_Invoice_Type (Name,Description)values(" + sPar_Name + "," + sPar_Description + ")";
                    object objretx = null;
                    if (Program.LocalDB_for_Tangenta.m_DBTables.m_con.ExecuteNonQuerySQLReturnID(sql, null, ref JOURNAL_Invoice_type_ID, ref objretx, ref Err, "JOURNAL_Invoice_Type"))
                    {
                        return true;
                    }
                    else
                    {
                        LogFile.Error.Show("ERROR:f_JOURNAL_Invoice_Type:Get:" + sql + "\r\nErr=" + Err);
                        return false;
                    }
                }
            }
            else
            {
                LogFile.Error.Show("ERROR:f_JOURNAL_Invoice_Type:Get:" + sql + "\r\nErr=" + Err);
                return false;
            }
        }
开发者ID:dstrucl,项目名称:Tangenta40,代码行数:51,代码来源:f_JOURNAL_Invoice_Type.cs

示例10: Get

        public static bool Get(decimal PricePerUnit,long ID_Taxation,long ID_Currency, ref long PurchasePrice_ID)
        {
            List<SQL_Parameter> lpar = new List<SQL_Parameter>();

            string spar_PricePerUnit = "@par_PricePerUnit";
            SQL_Parameter par_PricePerUnit = new SQL_Parameter(spar_PricePerUnit, SQL_Parameter.eSQL_Parameter.Decimal, false, PricePerUnit);
            lpar.Add(par_PricePerUnit);

            string spar_ID_Taxation = "@par_ID_Taxation";
            SQL_Parameter par_ID_Taxation = new SQL_Parameter(spar_ID_Taxation, SQL_Parameter.eSQL_Parameter.Bigint, false, ID_Taxation);
            lpar.Add(par_ID_Taxation);

            string spar_ID_Currency = "@par_ID_Currency";
            SQL_Parameter par_ID_Currency = new SQL_Parameter(spar_ID_Currency, SQL_Parameter.eSQL_Parameter.Bigint, false, ID_Currency);
            lpar.Add(par_ID_Currency);

            string sql = "select ID from PurchasePrice where PurchasePricePerUnit = " + spar_PricePerUnit + " and  Currency_ID = " + spar_ID_Currency + " and Taxation_ID = " + spar_ID_Taxation;
            DataTable dt = new DataTable();
            string Err = null;
            if (DBSync.DBSync.ReadDataTable(ref dt, sql, lpar, ref Err))
            {
                if (dt.Rows.Count > 0)
                {
                    PurchasePrice_ID = (long)dt.Rows[0]["ID"];
                    return true;
                }
                else
                {
                    DateTime dtPurchasePriceDate = DateTime.Now;
                    string spar_PurchasePriceDate = "@par_PurchasePriceDate";
                    SQL_Parameter par_PurchasePriceDate = new SQL_Parameter(spar_PurchasePriceDate, SQL_Parameter.eSQL_Parameter.Datetime, false, dtPurchasePriceDate);
                    lpar.Add(par_PurchasePriceDate);
                    sql = "insert into PurchasePrice (PurchasePricePerUnit,Currency_ID,Taxation_ID,PurchasePriceDate)values(" + spar_PricePerUnit + "," + spar_ID_Currency + "," + spar_ID_Taxation + ","+ spar_PurchasePriceDate + ")";
                    object oret = null;
                    if (DBSync.DBSync.ExecuteNonQuerySQLReturnID(sql, lpar, ref PurchasePrice_ID, ref oret, ref Err, "PurchasePrice"))
                    {
                        return true;
                    }
                    else
                    {
                        LogFile.Error.Show("ERROR:TangentaDB:f_PurchasePrice:Get:sql=" + sql + "\r\nErr=" + Err);
                        return false;
                    }
                }
            }
            else
            {
                LogFile.Error.Show("ERROR:TangentaDB:f_PurchasePrice:Get:sql=" + sql + "\r\nErr=" + Err);
                return false;
            }
        }
开发者ID:dstrucl,项目名称:Tangenta40,代码行数:51,代码来源:f_PurchasePrice.cs

示例11: AddPar

 public static bool AddPar(string spar, ref List<SQL_Parameter> lpar, object obj_v, ref string cond, ref string value)
 {
     string spar_name = "@par_" + spar;
     SQL_Parameter par = null;
     if (obj_v == null)
     {
         cond = spar + " is null ";
         value = "null";
     }
     else
     {
         if (obj_v is bool_v)
         {
             par = new SQL_Parameter(spar_name, SQL_Parameter.eSQL_Parameter.Bit, false, ((bool_v)obj_v).v);
         }
         else if (obj_v is string_v)
         {
             par = new SQL_Parameter(spar_name, SQL_Parameter.eSQL_Parameter.Nvarchar, false, ((string_v)obj_v).v);
         }
         else if (obj_v is int_v)
         {
             par = new SQL_Parameter(spar_name, SQL_Parameter.eSQL_Parameter.Int, false, ((int_v)obj_v).v);
         }
         else if (obj_v is long_v)
         {
             par = new SQL_Parameter(spar_name, SQL_Parameter.eSQL_Parameter.Bigint, false, ((long_v)obj_v).v);
         }
         else if (obj_v is DateTime_v)
         {
             par = new SQL_Parameter(spar_name, SQL_Parameter.eSQL_Parameter.Datetime, false, ((DateTime_v)obj_v).v);
         }
         else if (obj_v is byte_array_v)
         {
             par = new SQL_Parameter(spar_name, SQL_Parameter.eSQL_Parameter.Varbinary, false, ((byte_array_v)obj_v).v);
         }
         else
         {
             LogFile.Error.Show("ERROR:f_Atom_Customer_Person:AddPar: Type " + obj_v.GetType().ToString() + " not implemented!");
             return false;
         }
         cond = spar + " = " + spar_name;
         value = spar_name;
         if (lpar == null)
         {
             lpar = new List<SQL_Parameter>();
         }
         lpar.Add(par);
     }
     return true;
 }
开发者ID:dstrucl,项目名称:Tangenta40,代码行数:50,代码来源:fs.cs

示例12: Get

        public static bool Get(string ZIP, ref long cZIP_Org_ID)
        {
            string Err = null;

            List<SQL_Parameter> lpar = new List<SQL_Parameter>();
            string scond_ZIP = null;
            string sval_ZIP = "null";
            if (ZIP != null)
            {
                string spar_ZIP = "@par_ZIP";
                SQL_Parameter par_ZIP = new SQL_Parameter(spar_ZIP, SQL_Parameter.eSQL_Parameter.Nvarchar, false, ZIP);
                lpar.Add(par_ZIP);
                scond_ZIP = "ZIP = " + spar_ZIP;
                sval_ZIP = spar_ZIP;
            }
            else
            {
                scond_ZIP = "ZIP is null";
                sval_ZIP = "null";
            }
            DataTable dt = new DataTable();
            string sql = @"select ID from cZIP_Org where " + scond_ZIP;
            if (DBSync.DBSync.ReadDataTable(ref dt, sql, lpar, ref Err))
            {
                if (dt.Rows.Count > 0)
                {
                    cZIP_Org_ID = (long)dt.Rows[0]["ID"];
                    return true;
                }
                else
                {
                    sql = @"insert into cZIP_Org (ZIP) values (" + sval_ZIP + ")";
                    object objretx = null;
                    if (DBSync.DBSync.ExecuteNonQuerySQLReturnID(sql, lpar, ref cZIP_Org_ID, ref objretx, ref Err, "cZIP_Org"))
                    {
                        return true;
                    }
                    else
                    {
                        LogFile.Error.Show("ERROR:f_cZIP_Org:Get:sql=" + sql + "\r\nErr=" + Err);
                        return false;
                    }
                }
            }
            else
            {
                LogFile.Error.Show("ERROR:f_cZIP_Org:Get:sql=" + sql + "\r\nErr=" + Err);
                return false;
            }
        }
开发者ID:dstrucl,项目名称:Tangenta40,代码行数:50,代码来源:f_cZIP_org.cs

示例13: Get

        public static bool Get(string Name,string_v Description_v,ref long Language_ID)
        {
            List<SQL_Parameter> lpar = new List<SQL_Parameter>();

            //Table Language
            string spar_Name = "@par_Name";
            SQL_Parameter par_Name = new SQL_Parameter(spar_Name, SQL_Parameter.eSQL_Parameter.Nvarchar, false, Name);
            lpar.Add(par_Name);

            string spar_Description = "@par_Description";
            string sval_Description = "null";
            if (Description_v != null)
            {
                SQL_Parameter par_Description = new SQL_Parameter(spar_Description, SQL_Parameter.eSQL_Parameter.Nvarchar, false, Description_v.v);
                lpar.Add(par_Description);
                sval_Description = spar_Description;
            }

            string sql = "select ID from Language where Name = " + spar_Name + " and Description = " + sval_Description;
            DataTable dt = new DataTable();
            string Err = null;
            if (DBSync.DBSync.ReadDataTable(ref dt, sql, lpar, ref Err))
            {
                if (dt.Rows.Count > 0)
                {
                    Language_ID = (long)dt.Rows[0]["ID"];
                    return true;
                }
                else
                {
                    sql = "insert into Language (Name,Description,bDefault)values(" + spar_Name + "," + sval_Description + ",0)";
                    object oret = null;
                    if (DBSync.DBSync.ExecuteNonQuerySQLReturnID(sql, lpar, ref Language_ID, ref oret, ref Err, "Language"))
                    {
                        return true;
                    }
                    else
                    {
                        LogFile.Error.Show("ERROR:f_doc:InsertDefault:sql=" + sql + "\r\nErr=" + Err);
                        return false;
                    }
                }
            }
            else
            {
                LogFile.Error.Show("ERROR:f_Language:Get:sql=" + sql + "\r\nErr=" + Err);
                return false;
            }
        }
开发者ID:dstrucl,项目名称:Tangenta40,代码行数:49,代码来源:f_Language.cs

示例14: Get

        public static bool Get(long Invoice_ID, string xSerialNumber,string xSetNumber,string xInvoiceNumber, ref long FVI_SLO_SalesBookInvoice_ID)
        {
            string Err = null;
            DataTable dt = new DataTable();
            List<SQL_Parameter> lpar = new List<SQL_Parameter>();
            string spar_Invoice_ID = "@par_Invoice_ID";
            SQL_Parameter par_Invoice_ID = new SQL_Parameter(spar_Invoice_ID, SQL_Parameter.eSQL_Parameter.Bigint, false, Invoice_ID);
                lpar.Add(par_Invoice_ID);
            string spar_SerialNumber = "@par_SerialNumber";
            SQL_Parameter par_SerialNumber = new SQL_Parameter(spar_SerialNumber, SQL_Parameter.eSQL_Parameter.Varchar, false, xSerialNumber);
            lpar.Add(par_SerialNumber);
            string spar_SetNumber = "@par_SetNumber";
            SQL_Parameter par_SetNumber = new SQL_Parameter(spar_SetNumber, SQL_Parameter.eSQL_Parameter.Varchar, false, xSetNumber);
            lpar.Add(par_SetNumber);
            string spar_InvoiceNumber = "@par_InvoiceNumber";
            SQL_Parameter par_InvoiceNumber = new SQL_Parameter(spar_InvoiceNumber, SQL_Parameter.eSQL_Parameter.Varchar, false, xInvoiceNumber);
            lpar.Add(par_InvoiceNumber);

            string sql = @"select ID from FVI_SLO_SalesBookInvoice
                                where Invoice_ID = " + spar_Invoice_ID + " and SerialNumber = " + spar_SerialNumber + " and SetNumber = " + spar_SetNumber + " and InvoiceNumber = " + spar_InvoiceNumber;

            if (DBSync.DBSync.ReadDataTable(ref dt, sql, lpar, ref Err))
            {
                if (dt.Rows.Count > 0)
                {
                    FVI_SLO_SalesBookInvoice_ID = (long)dt.Rows[0]["ID"];
                    return true;
                }
                else
                {
                sql = @"insert into FVI_SLO_SalesBookInvoice (Invoice_ID,SerialNumber,SetNumber,InvoiceNumber) values(" + spar_Invoice_ID + "," + spar_SerialNumber + "," + spar_SetNumber + "," + spar_InvoiceNumber + ")";
                    object objretx = null;
                    if (DBSync.DBSync.ExecuteNonQuerySQLReturnID(sql, lpar, ref FVI_SLO_SalesBookInvoice_ID, ref objretx, ref Err, "FVI_SLO_SalesBookInvoice"))
                    {
                        return true;
                    }
                    else
                    {
                        LogFile.Error.Show("ERROR:f_FVI_SLO_SalesBookInvoice:Get:" + sql + "\r\nErr=" + Err);
                        return false;
                    }
                }
            }
            else
            {
                LogFile.Error.Show("ERROR:f_FVI_SLO_SalesBookInvoice:Get:" + sql + "\r\nErr=" + Err);
                return false;
            }
        }
开发者ID:dstrucl,项目名称:Tangenta40,代码行数:49,代码来源:f_FVI_SLO_SalesBookInvoice.cs

示例15: Get

        public static bool Get(string Name,decimal Rate, ref long Taxation_ID)
        {
            List<SQL_Parameter> lpar = new List<SQL_Parameter>();

            //Table Language
            string spar_Name = "@par_Name";
            SQL_Parameter par_Name = new SQL_Parameter(spar_Name, SQL_Parameter.eSQL_Parameter.Nvarchar, false, Name);
            lpar.Add(par_Name);

            string spar_Rate = "@par_Rate";
            string sval_Rate = "null";
            SQL_Parameter par_Rate = new SQL_Parameter(spar_Rate, SQL_Parameter.eSQL_Parameter.Decimal, false, Rate);
            lpar.Add(par_Rate);
            sval_Rate = spar_Rate;

            string sql = "select ID from Taxation where Name = " + spar_Name + " and Rate = " + sval_Rate;
            DataTable dt = new DataTable();
            string Err = null;
            if (DBSync.DBSync.ReadDataTable(ref dt, sql, lpar, ref Err))
            {
                if (dt.Rows.Count > 0)
                {
                    Taxation_ID = (long)dt.Rows[0]["ID"];
                    return true;
                }
                else
                {
                    sql = "insert into Taxation (Name,Rate)values(" + spar_Name + "," + sval_Rate + ")";
                    object oret = null;
                    if (DBSync.DBSync.ExecuteNonQuerySQLReturnID(sql, lpar, ref Taxation_ID, ref oret, ref Err, "Taxation"))
                    {
                        return true;
                    }
                    else
                    {
                        LogFile.Error.Show("ERROR:f_Taxation:InsertDefault:sql=" + sql + "\r\nErr=" + Err);
                        return false;
                    }
                }
            }
            else
            {
                LogFile.Error.Show("ERROR:f_Taxation:Get:sql=" + sql + "\r\nErr=" + Err);
                return false;
            }
        }
开发者ID:dstrucl,项目名称:Tangenta40,代码行数:46,代码来源:f_Taxation.cs


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