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


C# DataAccessLayer.ExecQuery方法代码示例

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


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

示例1: Save

    public int Save(PriviledgeDB objDB, SqlTransaction objTrans)
    {
        int PriviledgeID = 0;
        DataAccessLayer objDataLayer = new DataAccessLayer();
        SqlCommand objCmd = new SqlCommand();
        try
        {

            objCmd.CommandText = "usp_Priviledges";

            objCmd.CommandType = CommandType.StoredProcedure;
            objCmd.Parameters.AddWithValue("@FormID", objDB.FormID);
            objCmd.Parameters.AddWithValue("@RoleID", objDB.RoleID);

            objCmd.Parameters.AddWithValue("@viewing", objDB.viewing);

            objCmd.Parameters.AddWithValue("@PriviledgeID", SqlDbType.Int);
            objCmd.Parameters["@PriviledgeID"].Direction = ParameterDirection.Output;

            objCmd.Transaction = objTrans;
            objCmd.Connection = objTrans.Connection;
            objDataLayer.Command = objCmd;
            objDataLayer.ExecQuery();
            PriviledgeID = Convert.ToInt32(objCmd.Parameters["@PriviledgeID"].Value);
            return PriviledgeID;
        }
        catch (Exception ex)
        {

            throw ex;
        }
    }
开发者ID:krishnakant,项目名称:WMS,代码行数:32,代码来源:PriviledgeManager.cs

示例2: SaveMonthOpenClose

    public void SaveMonthOpenClose(MonthOpenCloseDB objDB, SqlTransaction objTrans)
    {
        DataAccessLayer objDataLayer = new DataAccessLayer();
        SqlCommand objCmd = new SqlCommand();
        try
        {
            objCmd.CommandText = "usp_SaveMonthOpenClose";
            objCmd.CommandType = CommandType.StoredProcedure;
            objCmd.Parameters.AddWithValue("@MonthID", objDB.MonthID);
            objCmd.Parameters.AddWithValue("@YearID", objDB.YearID);
            objCmd.Parameters.AddWithValue("@Status", objDB.Status);
            objCmd.Parameters.AddWithValue("@id", SqlDbType.Int);
            objCmd.Parameters["@id"].Direction = ParameterDirection.Output;

            objCmd.Transaction = objTrans;
            objCmd.Connection = objTrans.Connection;
            objDataLayer.Command = objCmd;
            objDataLayer.ExecQuery();

        }
        catch (Exception ex)
        {

            throw ex;
        }
    }
开发者ID:krishnakant,项目名称:WMS,代码行数:26,代码来源:MonthOpenCloseManager.cs

示例3: getModelMapping

    public int getModelMapping(Int64 TractorNo, SqlTransaction objTrans)
    {
        int ModelMappingID = 0;
        DataAccessLayer objDataLayer = new DataAccessLayer();
        SqlCommand objCmd = new SqlCommand();
        try
        {
            objCmd.CommandText = "usp_getModelMappingID";
            objCmd.CommandType = CommandType.StoredProcedure;
            objCmd.Parameters.AddWithValue("@TRACTOR_NO", TractorNo);
            objCmd.Parameters.AddWithValue("@ModelMappingID", SqlDbType.Int);
            objCmd.Parameters["@ModelMappingID"].Direction = ParameterDirection.Output;
            objCmd.Transaction = objTrans;
            objCmd.Connection = objTrans.Connection;
            objDataLayer.Command = objCmd;
            objDataLayer.ExecQuery();
            ModelMappingID = Convert.ToInt32(objCmd.Parameters["@ModelMappingID"].Value);
        }
        catch (Exception ex)
        {

            throw ex;
        }

        return ModelMappingID;
    }
开发者ID:krishnakant,项目名称:WMS,代码行数:26,代码来源:AcrManager.cs

示例4: SaveBudget

    public int SaveBudget(BudgetDB objDB, SqlTransaction objTrans)
    {
        int ID = 0;
        DataAccessLayer objDataLayer = new DataAccessLayer();
        SqlCommand objCmd = new SqlCommand();
        try
        {

            objCmd.CommandText = "usp_SaveBudget";
            objCmd.CommandType = CommandType.StoredProcedure;
            objCmd.Parameters.AddWithValue("@FinancialYear", objDB.FinancialYear);
            objCmd.Parameters.AddWithValue("@QuarterID", objDB.QuarterID);
            objCmd.Parameters.AddWithValue("@Budget", objDB.Budget);
            objCmd.Parameters.AddWithValue("@ModelGroupID", objDB.ModelGroupID);
            objCmd.Parameters.AddWithValue("@ModelCategoryID", objDB.ModelCategoryID);
            objCmd.Parameters.AddWithValue("@ModelClutchID", objDB.ModelClutchID);
            objCmd.Parameters.AddWithValue("@ModelSpecialID", objDB.ModelSpecialID);

            objCmd.Parameters.AddWithValue("@ID", SqlDbType.Int);
            objCmd.Parameters["@ID"].Direction = ParameterDirection.Output;

            objCmd.Transaction = objTrans;
            objCmd.Connection = objTrans.Connection;
            objDataLayer.Command = objCmd;
            objDataLayer.ExecQuery();
            ID = Convert.ToInt32(objCmd.Parameters["@ID"].Value);
            return ID;
        }
        catch (Exception ex)
        {

            throw ex;
        }
    }
开发者ID:krishnakant,项目名称:WMS,代码行数:34,代码来源:BudgetManager.cs

示例5: CheckMaterial

    public int CheckMaterial(ModelDB objDB, SqlTransaction objTrans)
    {
        int flag = 0;
        DataAccessLayer objDataLayer = new DataAccessLayer();
        SqlCommand objCmd = new SqlCommand();
        try
        {

            objCmd.CommandText = "Usp_CheckMaterial";
            objCmd.CommandType = CommandType.StoredProcedure;
            objCmd.Parameters.AddWithValue("@Material", objDB.Material);
            objCmd.Parameters.AddWithValue("@flag", SqlDbType.Int);
            objCmd.Parameters["@flag"].Direction = ParameterDirection.Output;
            objCmd.Transaction = objTrans;
            objCmd.Connection = objTrans.Connection;
            objDataLayer.Command = objCmd;
            objDataLayer.ExecQuery();
            flag = Convert.ToInt32(objCmd.Parameters["@flag"].Value);
            return flag;

        }
        catch (Exception ex)
        {

            throw ex;
        }
    }
开发者ID:krishnakant,项目名称:WMS,代码行数:27,代码来源:ModelManager.cs

示例6: SaveReworkCost

    public int SaveReworkCost(ReworkCostDB objDB, SqlTransaction objTrans)
    {
        int ID = 0;
        DataAccessLayer objDataLayer = new DataAccessLayer();
        SqlCommand objCmd = new SqlCommand();
        try
        {

            objCmd.CommandText = "usp_SaveReworkCost";
            objCmd.CommandType = CommandType.StoredProcedure;

            objCmd.Parameters.AddWithValue("@MonthID", objDB.MonthID);
            objCmd.Parameters.AddWithValue("@YearID", objDB.YearID);
            objCmd.Parameters.AddWithValue("@ModelGroupID", objDB.GroupID);
            objCmd.Parameters.AddWithValue("@ReworkCost_I_Year", objDB.ReworkCost_I_Year);
            objCmd.Parameters.AddWithValue("@ReworkCost_II_Year", objDB.ReworkCost_II_Year);
            objCmd.Parameters.AddWithValue("@ModelCategoryID", objDB.ModelCategoryID);
            objCmd.Parameters.AddWithValue("@HMR_Range", objDB.HMR_Range);
            objCmd.Parameters.AddWithValue("@ID", SqlDbType.Int);
            objCmd.Parameters["@ID"].Direction = ParameterDirection.Output;

            objCmd.Transaction = objTrans;
            objCmd.Connection = objTrans.Connection;
            objDataLayer.Command = objCmd;
            objDataLayer.ExecQuery();
            ID = Convert.ToInt32(objCmd.Parameters["@ID"].Value);
            return ID;
        }
        catch (Exception ex)
        {

            throw ex;
        }
    }
开发者ID:krishnakant,项目名称:WMS,代码行数:34,代码来源:ReworkCostManager.cs

示例7: DeleteGroupName

    public int DeleteGroupName(ConfiguratorDB objDB, SqlTransaction objTrans)
    {
        int StatusID = 0;
        DataAccessLayer objDataLayer = new DataAccessLayer();
        SqlCommand objCmd = new SqlCommand();
        try
        {
            if (objDB.source == "Model")
            {
                objCmd.CommandText = "Usp_DeleteGroupName";
            }
            if (objDB.source == "Culprit")
            {
                objCmd.CommandText = "Usp_DeletCulpritGroup";
            }
            if (objDB.source == "Defect")
            {
                objCmd.CommandText = "Usp_DeleteDefectGroup";
            }
            if (objDB.source == "Cvoice")
            {
                objCmd.CommandText = "Usp_DeleteCvoiceGroup";
            }
            if (objDB.source == "Item")
            {
                objCmd.CommandText = "Usp_DeleteItemGroup";
            }

            objCmd.CommandType = CommandType.StoredProcedure;

            objCmd.Parameters.AddWithValue("@GroupID", objDB.GroupID);

            objCmd.Parameters.AddWithValue("@StatusID", SqlDbType.Int);
            objCmd.Parameters["@StatusID"].Direction = ParameterDirection.Output;

            objCmd.Transaction = objTrans;
            objCmd.Connection = objTrans.Connection;
            objDataLayer.Command = objCmd;
            objDataLayer.ExecQuery();
            StatusID = Convert.ToInt32(objCmd.Parameters["@StatusID"].Value);
            return StatusID;
        }
        catch (Exception ex)
        {

            throw ex;
        }
    }
开发者ID:krishnakant,项目名称:WMS,代码行数:48,代码来源:ConfiguratorManager.cs

示例8: SaveDealer

    public int SaveDealer(DealerDB objDB, SqlTransaction objTrans)
    {
        int DealerID = 0;
        DataAccessLayer objDataLayer = new DataAccessLayer();
        SqlCommand objCmd = new SqlCommand();
        try
        {
            if (objDB.CheckID == 0)
            {
                objCmd.CommandText = "usp_SaveDealer";
            }
            else
            {
                objCmd.CommandText = "usp_UpdateDealer";
                objCmd.Parameters.AddWithValue("@Id", objDB.Id);
            }

            objCmd.CommandType = CommandType.StoredProcedure;

            objCmd.Parameters.AddWithValue("@Dealer", objDB.Dealer);
            objCmd.Parameters.AddWithValue("@Code", objDB.Code);
            objCmd.Parameters.AddWithValue("@RegionID", objDB.RegionID);
            objCmd.Parameters.AddWithValue("@City", objDB.City);
            objCmd.Parameters.AddWithValue("@InstallerName", objDB.InstallerName);
            objCmd.Parameters.AddWithValue("@IsActive", objDB.IsActive);
            objCmd.Parameters.AddWithValue("@IsOperatingDealer", objDB.IsOperatingDealer);
            objCmd.Parameters.AddWithValue("@DealerID", SqlDbType.Int);
            objCmd.Parameters["@DealerID"].Direction = ParameterDirection.Output;

            objCmd.Transaction = objTrans;
            objCmd.Connection = objTrans.Connection;
            objDataLayer.Command = objCmd;
            objDataLayer.ExecQuery();
            DealerID = Convert.ToInt32(objCmd.Parameters["@DealerID"].Value);
            return DealerID;
        }
        catch (Exception ex)
        {

            throw ex;
        }
    }
开发者ID:krishnakant,项目名称:WMS,代码行数:42,代码来源:DealerManager.cs

示例9: AddCulprit

    public int AddCulprit(CulpritDB objDB, SqlTransaction objTrans)
    {
        DataAccessLayer objDataLayer = new DataAccessLayer();
        SqlCommand objCmd = new SqlCommand();
        int Status = 0;
        try
        {

            if (objDB.StatusID == 0)
            {
                objCmd.CommandText = "usp_AddCulprit";
            }
            else
            {
                objCmd.CommandText = "usp_UpdateCulprit";
            }
            objCmd.CommandType = CommandType.StoredProcedure;
            objCmd.Parameters.AddWithValue("@Code", objDB.CulpritCode);
            objCmd.Parameters.AddWithValue("@GroupID", objDB.GroupID);
            objCmd.Parameters.AddWithValue("@Description", objDB.Description);
            objCmd.Parameters.AddWithValue("@IsActive", objDB.IsActive);
            objCmd.Parameters.AddWithValue("@InReport", objDB.InReport);
            objCmd.Parameters.AddWithValue("@IsGroup", objDB.IsGroup);
            objCmd.Parameters.AddWithValue("@EffectDate", objDB.EffectDate);

            objCmd.Transaction = objTrans;
            objCmd.Connection = objTrans.Connection;
            objDataLayer.Command = objCmd;
            objDataLayer.ExecQuery();

            // Status = Convert.ToInt32(objCmd.Parameters["@Status"].Value);

        }
        catch (Exception ex)
        {

            throw ex;
        }
        return Status;
    }
开发者ID:krishnakant,项目名称:WMS,代码行数:40,代码来源:MastersManager.cs

示例10: SaveRole

    public int SaveRole(RoleDB objDB, SqlTransaction objTrans)
    {
        int RoleID = 0;
        DataAccessLayer objDataLayer = new DataAccessLayer();
        SqlCommand objCmd = new SqlCommand();
        try
        {
            if (objDB.CheckID == 0)
            {
                objCmd.CommandText = "usp_SaveRole";
            }
            else
            {
                objCmd.CommandText = "usp_UpdateRole";
                objCmd.Parameters.AddWithValue("@Id", objDB.Id);
            }

            objCmd.CommandType = CommandType.StoredProcedure;

            objCmd.Parameters.AddWithValue("@Role", objDB.Role);

            objCmd.Parameters.AddWithValue("@IsActive", objDB.IsActive);

            objCmd.Parameters.AddWithValue("@RoleID", SqlDbType.Int);
            objCmd.Parameters["@RoleID"].Direction = ParameterDirection.Output;

            objCmd.Transaction = objTrans;
            objCmd.Connection = objTrans.Connection;
            objDataLayer.Command = objCmd;
            objDataLayer.ExecQuery();
            RoleID = Convert.ToInt32(objCmd.Parameters["@RoleID"].Value);
            return RoleID;
        }
        catch (Exception ex)
        {

            throw ex;
        }
    }
开发者ID:krishnakant,项目名称:WMS,代码行数:39,代码来源:RoleManager.cs

示例11: SaveBulkAcr

    public int SaveBulkAcr( SqlTransaction objTrans)
    {
        int ID = 0;
        DataAccessLayer objDataLayer = new DataAccessLayer();
        SqlCommand objCmd = new SqlCommand();
        try
        {
            objCmd.CommandText = "usp_AcrBulkDataInsert";
            objCmd.CommandType = CommandType.StoredProcedure;
            objCmd.Parameters.AddWithValue("@count", SqlDbType.Int);
            objCmd.Parameters["@count"].Direction = ParameterDirection.Output;
            objCmd.Transaction = objTrans;
            objCmd.Connection = objTrans.Connection;
            objDataLayer.Command = objCmd;
            objDataLayer.ExecQuery();
            ID = Convert.ToInt32(objCmd.Parameters["@count"].Value);
        }
        catch (Exception ex)
        {

            throw ex;
        }

        return ID;
    }
开发者ID:krishnakant,项目名称:WMS,代码行数:25,代码来源:AcrManager.cs

示例12: SaveAcrData

    public void SaveAcrData(SqlTransaction objTrans)
    {
        DataAccessLayer objDataLayer = new DataAccessLayer();
        SqlCommand objCmd = new SqlCommand();
        try
        {
            objCmd.CommandText = "usp_AcrDataInsert";
            objCmd.CommandType = CommandType.StoredProcedure;

            objCmd.Transaction = objTrans;
            objCmd.Connection = objTrans.Connection;
            objDataLayer.Command = objCmd;
            objDataLayer.ExecQuery();

        }
        catch (Exception ex)
        {

            throw ex;
        }
    }
开发者ID:krishnakant,项目名称:WMS,代码行数:21,代码来源:AcrManager.cs

示例13: Save

    public int Save(ConfiguratorDB objDB, SqlTransaction objTrans)
    {
        int modelGroupID = 0;
        DataAccessLayer objDataLayer = new DataAccessLayer();
        SqlCommand objCmd = new SqlCommand();
        try
        {
            objCmd.CommandText = "usp_SaveProductGroupMapping";
            objCmd.CommandType = CommandType.StoredProcedure;

            objCmd.Parameters.AddWithValue("@ModelGroupName", objDB.ModelGroupName);
            objCmd.Parameters.AddWithValue("@IsNew", objDB.IsNew);
            objCmd.Parameters.AddWithValue("@WarrantyPeriod", objDB.WarrantyPeriod);

            objCmd.Parameters.AddWithValue("@ProductGroupMappingID", SqlDbType.Int);
            objCmd.Parameters["@ProductGroupMappingID"].Direction = ParameterDirection.Output;

            objCmd.Transaction = objTrans;
            objCmd.Connection = objTrans.Connection;
            objDataLayer.Command = objCmd;
            objDataLayer.ExecQuery();
            modelGroupID = Convert.ToInt32(objCmd.Parameters["@ProductGroupMappingID"].Value);
            return modelGroupID;
        }
        catch (Exception ex)
        {

            throw ex;
        }
    }
开发者ID:krishnakant,项目名称:WMS,代码行数:30,代码来源:ConfiguratorManager.cs

示例14: SaveProductGroupMapping

    public int SaveProductGroupMapping(ConfiguratorDB objDB, SqlTransaction objTrans)
    {
        int modelGroupID = 0;
        DataAccessLayer objDataLayer = new DataAccessLayer();
        SqlCommand objCmd = new SqlCommand();
        try
        {
            if (objDB.source == "Configurator")
            {
                objCmd.CommandText = "usp_SaveProductCodeMapping";
            }
            else
            {
                objCmd.CommandText = "usp_SaveModelException";
            }
            objCmd.CommandType = CommandType.StoredProcedure;

            objCmd.Parameters.AddWithValue("@ProductCodeID", objDB.ID);
            objCmd.Parameters.AddWithValue("@GroupID", objDB.GroupID);

            objCmd.Parameters.AddWithValue("@ProductCodeMappingID", SqlDbType.Int);
            objCmd.Parameters["@ProductCodeMappingID"].Direction = ParameterDirection.Output;

            objCmd.Transaction = objTrans;
            objCmd.Connection = objTrans.Connection;
            objDataLayer.Command = objCmd;
            objDataLayer.ExecQuery();
            modelGroupID = Convert.ToInt32(objCmd.Parameters["@ProductCodeMappingID"].Value);
            return modelGroupID;
        }
        catch (Exception ex)
        {

            throw ex;
        }
    }
开发者ID:krishnakant,项目名称:WMS,代码行数:36,代码来源:ConfiguratorManager.cs

示例15: SaveItem

    public int SaveItem(ItemDB objDB, SqlTransaction objTrans)
    {
        DataAccessLayer objDataLayer = new DataAccessLayer();
        SqlCommand objCmd = new SqlCommand();
        int Status = 0;
        try
        {
            objCmd.CommandText = "usp_UpdateItemException";
            objCmd.CommandType = CommandType.StoredProcedure;
            objCmd.Parameters.AddWithValue("@ItemCode",objDB.ItemCode);
            objCmd.Parameters.AddWithValue("@ItemGroupName", objDB.ItemGroupName);
            objCmd.Parameters.AddWithValue("@GroupID", objDB.GroupID);
            objCmd.Transaction = objTrans;
            objCmd.Connection = objTrans.Connection;
            objDataLayer.Command = objCmd;
            objDataLayer.ExecQuery();
        }
        catch (Exception ex)
        {

            throw ex;
        }
        return Status;
    }
开发者ID:krishnakant,项目名称:WMS,代码行数:24,代码来源:MastersManager.cs


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