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


C# DataManager.Add方法代码示例

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


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

示例1: ProductMassDelete

        public void ProductMassDelete(string sID_LIST)
        {
            using (var oDm = new DataManager())
            {
                oDm.Add("@ID_LIST", SqlDbType.VarChar, 8000, sID_LIST);
                oDm.Add("@MODIFIED_USER_ID", SqlDbType.UniqueIdentifier, Security.USER_ID);

                oDm.CommandType = CommandType.StoredProcedure;
                oDm.ExecuteNonQuery("stp_Zpro_PRODUCTS_MassDelete");
            }
        }
开发者ID:BGCX261,项目名称:zproinvoice-svn-to-git,代码行数:11,代码来源:ProductDBManager.cs

示例2: ProductDelete

        public void ProductDelete(Guid gID)
        {
            using (var oDm = new DataManager())
            {
                oDm.Add("@ID", SqlDbType.UniqueIdentifier, gID);
                oDm.Add("@MODIFIED_USER_ID", SqlDbType.UniqueIdentifier, Security.USER_ID);

                oDm.CommandType = CommandType.StoredProcedure;
                oDm.ExecuteNonQuery("stp_Zpro_PRODUCTS_Delete");
            }
        }
开发者ID:BGCX261,项目名称:zproinvoice-svn-to-git,代码行数:11,代码来源:ProductDBManager.cs

示例3: ProductProductUpdate

        public void ProductProductUpdate(Guid gPARENT_ID, Guid gCHILD_ID)
        {
            using (var oDm = new DataManager())
            {
                oDm.Add("@MODIFIED_USER_ID", SqlDbType.UniqueIdentifier, Security.USER_ID);
                oDm.Add("@PARENT_ID", SqlDbType.UniqueIdentifier, gPARENT_ID);
                oDm.Add("@CHILD_ID", SqlDbType.UniqueIdentifier, gCHILD_ID);

                oDm.CommandType = CommandType.StoredProcedure;
                oDm.ExecuteNonQuery("stp_Zpro_PRODUCT_PRODUCT_Update");
            }
        }
开发者ID:BGCX261,项目名称:zproinvoice-svn-to-git,代码行数:12,代码来源:ProductDBManager.cs

示例4: ProductCategoriesUpdate

        public void ProductCategoriesUpdate(ref Guid gID, Guid gPARENT_ID, string sNAME, string sDESCRIPTION,
            Int32 nLIST_ORDER)
        {
            using (var oDm = new DataManager())
            {
                oDm.Add("@ID", SqlDbType.UniqueIdentifier, ParameterDirection.InputOutput, gID);
                oDm.Add("@MODIFIED_USER_ID", SqlDbType.UniqueIdentifier, Security.USER_ID);
                oDm.Add("@PARENT_ID", SqlDbType.UniqueIdentifier, Security.USER_ID);
                oDm.Add("@NAME", SqlDbType.NVarChar, 50, gPARENT_ID);
                oDm.Add("@DESCRIPTION", SqlDbType.NText, sDESCRIPTION);
                oDm.Add("@LIST_ORDER", SqlDbType.Int, nLIST_ORDER);

                oDm.CommandType = CommandType.StoredProcedure;
                oDm.ExecuteNonQuery("stp_Zpro_PRODUCT_CATEGORIES_Update");
                gID = CommonTypeConvert.ToGuid(oDm["@ID"].Value);
            }
        }
开发者ID:BGCX261,项目名称:zproinvoice-svn-to-git,代码行数:17,代码来源:ProductDBManager.cs

示例5: ProductUpdate

        public void ProductUpdate(ref Guid gID, Guid gPRODUCT_TEMPLATE_ID, string sNAME, string sSTATUS,
            Guid gACCOUNT_ID, Guid gCONTACT_ID, Int32 nQUANTITY, DateTime dtDATE_PURCHASED,
            DateTime dtDATE_SUPPORT_EXPIRES, DateTime dtDATE_SUPPORT_STARTS, Guid gMANUFACTURER_ID,
            Guid gCATEGORY_ID, Guid gTYPE_ID, string sWEBSITE, string sMFT_PART_NUM,
            string sVENDOR_PART_NUM, string sSERIAL_NUMBER, string sASSET_NUMBER,
            string sTAX_CLASS, float flWEIGHT, Guid gCURRENCY_ID, decimal dCOST_PRICE,
            decimal dLIST_PRICE, decimal dBOOK_VALUE, DateTime dtBOOK_VALUE_DATE,
            decimal dDISCOUNT_PRICE, Int32 nPRICING_FACTOR, string sPRICING_FORMULA,
            string sSUPPORT_NAME, string sSUPPORT_CONTACT, string sSUPPORT_DESCRIPTION,
            string sSUPPORT_TERM, string sDESCRIPTION, Guid gTEAM_ID)
        {
            using (var oDm = new DataManager())
            {
                oDm.Add("@ID", SqlDbType.UniqueIdentifier, ParameterDirection.InputOutput, gID);
                oDm.Add("@MODIFIED_USER_ID", SqlDbType.UniqueIdentifier, Security.USER_ID);
                oDm.Add("@PRODUCT_TEMPLATE_ID", SqlDbType.UniqueIdentifier, gPRODUCT_TEMPLATE_ID);
                oDm.Add("@NAME", SqlDbType.NVarChar, 50, sNAME);
                oDm.Add("@STATUS", SqlDbType.NVarChar, 25, sSTATUS);
                oDm.Add("@ACCOUNT_ID", SqlDbType.UniqueIdentifier, gACCOUNT_ID);
                oDm.Add("@CONTACT_ID", SqlDbType.UniqueIdentifier, gCONTACT_ID);
                oDm.Add("@QUANTITY", SqlDbType.Int, nQUANTITY);
                oDm.Add("@DATE_PURCHASED", SqlDbType.DateTime, dtDATE_PURCHASED);
                oDm.Add("@DATE_SUPPORT_EXPIRES", SqlDbType.DateTime, dtDATE_SUPPORT_EXPIRES); //DATE_COST_PRICE
                oDm.Add("@DATE_SUPPORT_STARTS", SqlDbType.DateTime, dtDATE_SUPPORT_STARTS);
                oDm.Add("@MANUFACTURER_ID", SqlDbType.UniqueIdentifier, gMANUFACTURER_ID);
                oDm.Add("@CATEGORY_ID", SqlDbType.UniqueIdentifier, gCATEGORY_ID);
                oDm.Add("@TYPE_ID", SqlDbType.UniqueIdentifier, gTYPE_ID);
                oDm.Add("@WEBSITE", SqlDbType.NVarChar, 255, sWEBSITE);
                oDm.Add("@MFT_PART_NUM", SqlDbType.NVarChar, 50, sMFT_PART_NUM);
                oDm.Add("@VENDOR_PART_NUM", SqlDbType.NVarChar, 50, sVENDOR_PART_NUM);
                oDm.Add("@SERIAL_NUMBER", SqlDbType.NVarChar, 50, sSERIAL_NUMBER);
                oDm.Add("@ASSET_NUMBER", SqlDbType.NVarChar, 50, sASSET_NUMBER);
                oDm.Add("TAX_CLASS", SqlDbType.NVarChar, 25, sTAX_CLASS);
                oDm.Add("@WEIGHT", SqlDbType.Float, 53, flWEIGHT);
                oDm.Add("@CURRENCY_ID", SqlDbType.UniqueIdentifier, gCURRENCY_ID);
                oDm.Add("@COST_PRICE", SqlDbType.Decimal, dCOST_PRICE); //--
                oDm.Add("@LIST_PRICE", SqlDbType.Decimal, dLIST_PRICE);
                oDm.Add("@BOOK_VALUE", SqlDbType.Money, dBOOK_VALUE);
                oDm.Add("@BOOK_VALUE_DATE", SqlDbType.DateTime, dtBOOK_VALUE_DATE);
                oDm.Add("@DISCOUNT_PRICE", SqlDbType.Decimal, dDISCOUNT_PRICE);
                oDm.Add("@PRICING_FACTOR", SqlDbType.Int, nPRICING_FACTOR);
                oDm.Add("@PRICING_FORMULA", SqlDbType.NVarChar, 25, sPRICING_FORMULA);
                oDm.Add("@SUPPORT_NAME", SqlDbType.NVarChar, 50, sSUPPORT_NAME);
                oDm.Add("@SUPPORT_CONTACT", SqlDbType.NVarChar, 50, sSUPPORT_CONTACT);
                oDm.Add("@SUPPORT_DESCRIPTION", SqlDbType.NVarChar, 255, sSUPPORT_DESCRIPTION);
                oDm.Add("@SUPPORT_TERM", SqlDbType.NVarChar, 25, sSUPPORT_TERM);
                oDm.Add("@DESCRIPTION", SqlDbType.Text, sDESCRIPTION);
                oDm.Add("@TeamID", SqlDbType.UniqueIdentifier, gTEAM_ID);

                oDm.CommandType = CommandType.StoredProcedure;
                oDm.ExecuteNonQuery("stp_Zpro_PRODUCTS_Update");
                gID = CommonTypeConvert.ToGuid(oDm["@ID"].Value);
            }
        }
开发者ID:BGCX261,项目名称:zproinvoice-svn-to-git,代码行数:54,代码来源:ProductDBManager.cs

示例6: button1_Click

        private void button1_Click(object sender, EventArgs e)
        {
            if (comboBox1.SelectedIndex == -1 || comboBox2.SelectedIndex == -1)
            {
                return;
            }
            insertListView.Columns.Clear();
            deleteListView.Columns.Clear();
            insertListView.Clear();
            deleteListView.Clear();
            updateListView.Columns.Clear();
            updateListView.Clear();
            var metadata = new DataManager().MetaData(this.comboBox1.SelectedItem.ToString(), this.comboBox2.SelectedItem.ToString());
            var redoInsert = "INSERT INTO " + this.comboBox2.SelectedItem.ToString() + "(";
            var undoInsert = "DELETE FROM " + this.comboBox2.SelectedItem.ToString() + " WHERE ";
            for (int i = 0, x = 0; i < metadata.Count - x; i++)
            {
                if (metadata.ElementAt(i).Types == Types.VarChar)
                {
                    var value = metadata.ElementAt(i);
                    metadata.RemoveAt(i);
                    metadata.Add(value);
                    i = -1;
                    x++;
                }
            }

            insertListView.Columns.Add("Transaction ID");
            insertListView.Columns.Add("Begin Time");
            deleteListView.Columns.Add("Transaction ID");
            deleteListView.Columns.Add("Begin Time");
            updateListView.Columns.Add("Transaction ID");
            updateListView.Columns.Add("Begin Time");
            ;            for (var i = 0; i < metadata.Count; i++)
            {

                if (i == metadata.Count - 1)
                {
                    this.deleteListView.Columns.Add(metadata[i].Name);
                    insertListView.Columns.Add(metadata[i].Name);
                    updateListView.Columns.Add(metadata[i].Name);
                    redoInsert += metadata[i].Name + ")";
                }
                else
                {
                    this.deleteListView.Columns.Add(metadata[i].Name);
                    insertListView.Columns.Add(metadata[i].Name);
                    updateListView.Columns.Add(metadata[i].Name);
                    redoInsert += metadata[i].Name + ",";
                }
            }
            this.deleteListView.Columns.Add("Redo SQL");
            this.deleteListView.Columns.Add("Undo SQL");
            insertListView.Columns.Add("Redo SQL");
            insertListView.Columns.Add("Undo SQL");
            updateListView.Columns.Add("Redo SQL");
            updateListView.Columns.Add("Undo SQL");

            redoInsert += " values(";

            AddValues(metadata, "LOP_DELETE_ROWS", undoInsert, redoInsert, metadata);
            AddValues(metadata, "LOP_INSERT_ROWS", redoInsert, undoInsert, metadata);
        }
开发者ID:edwherrera,项目名称:SQLServerLogMiner_TBD2,代码行数:63,代码来源:Form1.cs


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