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


C# Database.GetParameterValue方法代码示例

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


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

示例1: Insert

        public bool Insert(Photo photo, Database db, DbTransaction transaction = null)
        {
            DbCommand command = db.GetStoredProcCommand("usp_PhotoInsert");
            photo.PhotoId = Guid.NewGuid();

            db.AddInParameter(command, "PhotoId", DbType.Guid, photo.PhotoId);
            db.AddInParameter(command, "FileName", DbType.String, photo.FileName);
            db.AddInParameter(command, "FilePath", DbType.String, photo.FilePath);
            db.AddInParameter(command, "ContextId", DbType.Guid, photo.ContextId);
            db.AddInParameter(command, "Description", DbType.String, photo.Description);
            db.AddInParameter(command, "ContextTypeId", DbType.Int32, (int)photo.ContextType);
            db.AddInParameter(command, "ContextSubTypeId", DbType.Int32, photo.ContextSubTypeId);
            db.AddInParameter(command, "PhotoCategoryId", DbType.Int32, (int)photo.PhotoCategory);

            db.AddInParameter(command, "IsDeleted", DbType.String, photo.IsDeleted);
            db.AddInParameter(command, "CreatedBy", DbType.Guid, photo.CreatedBy);
            db.AddOutParameter(command, "CreatedDate", DbType.DateTime, 30);

            if (transaction == null)
            {
                db.ExecuteNonQuery(command);
            }
            else
            {
                db.ExecuteNonQuery(command, transaction);
            }

            photo.CreatedDate = Convert.ToDateTime(db.GetParameterValue(command, "CreatedDate").ToString());
            photo.UpdatedDate = photo.CreatedDate;

            return true;
        }
开发者ID:nirshandileep,项目名称:RHP,代码行数:32,代码来源:PhotoDAO.cs

示例2: RegistrarAutos

        //Funcion para registrar autos
        public int RegistrarAutos(Autos DatosA, DbTransaction tran, Database db)
        {
            string sqlCommand = "dbo.insertar_autos";
            DbCommand dbCommand = db.GetStoredProcCommand(sqlCommand);

            try {
                db.AddInParameter(dbCommand, "@INTplaca", DbType.Int32, Utilerías.ObtenerValor(DatosA.Placa));
                db.AddInParameter(dbCommand, "@STRmarca", DbType.String, Utilerías.ObtenerValor(DatosA.Marca));
                db.AddInParameter(dbCommand, "@STRmodelo", DbType.String, Utilerías.ObtenerValor(DatosA.Modelo));
                db.AddInParameter(dbCommand, "@INTanno", DbType.Int32, Utilerías.ObtenerValor(DatosA.Año));
                db.AddInParameter(dbCommand, "@INTnumero_vin", DbType.Int32, Utilerías.ObtenerValor(DatosA.Vin));
                db.AddInParameter(dbCommand, "@STRcolor", DbType.String, Utilerías.ObtenerValor(DatosA.Color));
                db.AddOutParameter(dbCommand, "@nStatus", DbType.Int16, 2);
                db.AddOutParameter(dbCommand, "@strMessage", DbType.String, 250);
                db.AddOutParameter(dbCommand, "@INTid_Auto", DbType.Int32, 4);

                db.ExecuteNonQuery(dbCommand, tran);

                if (int.Parse(db.GetParameterValue(dbCommand, "@nStatus").ToString()) > 0)
                    throw new Exception(db.GetParameterValue(dbCommand, "@strMessage").ToString());

                //retorna el id del auto que acaba de registrar
                return int.Parse(db.GetParameterValue(dbCommand, "@INTid_Auto").ToString());

            } catch (Exception ex) {
                throw new Exception(ex.Message);
            }
        }
开发者ID:alonsovb,项目名称:jazz-taller,代码行数:29,代码来源:RegistrosDAL.cs

示例3: Insert

        public bool Insert(Option Option, Database db, DbTransaction transaction)
        {
            DbCommand command = db.GetStoredProcCommand("usp_OptionInsert");

            db.AddInParameter(command, "Name", DbType.String, Option.Name);
            db.AddInParameter(command, "Description", DbType.String, Option.Description);
            db.AddInParameter(command, "OptionCategoryId", DbType.Int16, Option.OptionCategoryId);
            db.AddInParameter(command, "ParentOptionId", DbType.Int16, Option.ParentOptionId);
            db.AddInParameter(command, "IsDeleted", DbType.Boolean, Option.IsDeleted);
            db.AddInParameter(command, "IsMultiSelect", DbType.Boolean, Option.IsMultiSelect);
            db.AddInParameter(command, "Points", DbType.Int16, Option.Points);

            db.AddOutParameter(command, "OptionId", DbType.Int16, 3);

            if (transaction == null)
            {
                db.ExecuteNonQuery(command);
            }
            else
            {
                db.ExecuteNonQuery(command, transaction);
            }

            Option.OptionId = Convert.ToInt16(db.GetParameterValue(command, "OptionId").ToString());

            return true;
        }
开发者ID:nirshandileep,项目名称:RHP,代码行数:27,代码来源:PropertyOptionDAO.cs

示例4: Insert

        public bool Insert(OptionItem OptionItem, Database db, DbTransaction transaction)
        {
            DbCommand command = db.GetStoredProcCommand("usp_OptionItemInsert");

            db.AddInParameter(command, "Name", DbType.String, OptionItem.Name);
            db.AddInParameter(command, "Description", DbType.String, OptionItem.Description);
            db.AddInParameter(command, "IsDeleted", DbType.Boolean, OptionItem.IsDeleted);
            db.AddInParameter(command, "OptionId", DbType.Int16, OptionItem.OptionId);
            db.AddInParameter(command, "CreatedBy", DbType.Guid, OptionItem.CreatedBy);

            db.AddOutParameter(command, "OptionItemId", DbType.Int16, 3);

            if (transaction == null)
            {
                db.ExecuteNonQuery(command);
            }
            else
            {
                db.ExecuteNonQuery(command, transaction);
            }

            OptionItem.OptionItemId = Convert.ToInt16(db.GetParameterValue(command, "OptionItemId").ToString());

            return true;
        }
开发者ID:nirshandileep,项目名称:RHP,代码行数:25,代码来源:PropertyOptionItemDAO.cs

示例5: Insert

        public bool Insert(PartialUser partialUser, Database db, DbTransaction transaction)
        {
            DbCommand command = db.GetStoredProcCommand("usp_PartialUserInsert");

            partialUser.PartialUserId = Guid.NewGuid();

            db.AddInParameter(command, "PartialUserId", DbType.Guid, partialUser.PartialUserId);
            db.AddInParameter(command, "Email", DbType.String, partialUser.Email);
            db.AddInParameter(command, "FirstName", DbType.String, partialUser.FirstName);
            db.AddInParameter(command, "MiddleName", DbType.String, partialUser.MiddleName);
            db.AddInParameter(command, "LastName", DbType.String, partialUser.LastName);
            db.AddInParameter(command, "Contact", DbType.String, partialUser.Contact);
            db.AddInParameter(command, "RoleId", DbType.Guid, partialUser.RoleId);
            db.AddInParameter(command, "UserId", DbType.Guid, partialUser.UserId);
            db.AddInParameter(command, "PartialHouseId", DbType.Guid, partialUser.PartialHouseId);
            db.AddInParameter(command, "IsDeleted", DbType.Boolean, partialUser.IsDeleted);
            db.AddInParameter(command, "CreatedBy", DbType.Guid, partialUser.CreatedBy);

            db.AddOutParameter(command, "CreatedDate", DbType.DateTime, 30);

            db.ExecuteNonQuery(command, transaction);

            partialUser.CreatedDate = Convert.ToDateTime(db.GetParameterValue(command, "CreatedDate").ToString());
            partialUser.UpdatedDate = partialUser.CreatedDate;

            return true;
        }
开发者ID:nirshandileep,项目名称:RHP,代码行数:27,代码来源:PartialUserDAO.cs

示例6: Insert

        public bool Insert(School school, Database db, DbTransaction transaction)
        {
            DbCommand command = db.GetStoredProcCommand("usp_SchoolInsert");

            db.AddInParameter(command, "SchoolId", DbType.Guid, Guid.NewGuid());
            db.AddInParameter(command, "Name", DbType.String, school.Name);
            db.AddInParameter(command, "StreetAddress", DbType.String, school.StreetAddress);
            db.AddInParameter(command, "City", DbType.String, school.City);
            db.AddInParameter(command, "State", DbType.String, school.State);
            db.AddInParameter(command, "Zip", DbType.String, school.Zip);
            db.AddInParameter(command, "ContactNumber", DbType.String, school.ContactNumber);
            db.AddInParameter(command, "Email", DbType.String, school.Email);
            db.AddInParameter(command, "Location", DbType.String, school.Location);
            db.AddInParameter(command, "WebsiteURL", DbType.String, school.WebsiteURL);
            db.AddInParameter(command, "RatingValue", DbType.Decimal, school.RatingValue);
            db.AddInParameter(command, "CreatedBy", DbType.Guid, school.CreatedBy);

            db.AddOutParameter(command, "CreatedDate", DbType.DateTime, 30);

            if (transaction == null)
            {
                db.ExecuteNonQuery(command);
            }
            else
            {
                db.ExecuteNonQuery(command, transaction);
            }

            school.CreatedDate = Convert.ToDateTime(db.GetParameterValue(command, "CreatedDate").ToString());
            school.UpdatedDate = school.CreatedDate;

            return true;
        }
开发者ID:nirshandileep,项目名称:RHP,代码行数:33,代码来源:SchoolDAO.cs

示例7: Insert

        public bool Insert(Student student, Database db, DbTransaction transaction)
        {
            DbCommand command = db.GetStoredProcCommand("usp_StudentInsert");

            db.AddInParameter(command, "StudentId", DbType.Guid, Guid.NewGuid());
            db.AddInParameter(command, "UserId", DbType.Guid, student.StudentUser.UserId);
            db.AddInParameter(command, "SchoolId", DbType.Guid, student.School.SchoolId);
            db.AddInParameter(command, "IsDeleted", DbType.Boolean, student.IsDeleted);
            db.AddInParameter(command, "Year", DbType.String, student.School.Year);
            db.AddInParameter(command, "StartYear", DbType.String, student.StartYear);
            db.AddInParameter(command, "StartMonth", DbType.String, student.StartMonth);
            db.AddInParameter(command, "Status", DbType.String, student.Status);
            db.AddInParameter(command, "PreviousSchoolInfo", DbType.String, student.PreviousSchoolInfo);
            db.AddInParameter(command, "PreviousSchool", DbType.String, student.PreviousSchool);
            db.AddInParameter(command, "MajorId", DbType.Int16, student.MajorId);
            db.AddInParameter(command, "CreatedBy", DbType.Guid, student.CreatedBy);

            db.AddOutParameter(command, "CreatedDate", DbType.DateTime, 30);

            db.ExecuteNonQuery(command, transaction);

            student.CreatedDate = Convert.ToDateTime(db.GetParameterValue(command, "CreatedDate").ToString());
            student.UpdatedDate = student.CreatedDate;

            return true;
        }
开发者ID:nirshandileep,项目名称:RHP,代码行数:26,代码来源:StudentDAO.cs

示例8: Delete

        public bool Delete(User user, Database db, DbTransaction transaction)
        {
            DbCommand command = db.GetStoredProcCommand("usp_UserDelete");

            db.AddInParameter(command, "UpdatedBy", DbType.Guid, user.UpdatedBy);
            db.AddInParameter(command, "UserId", DbType.Guid, user.UserId);

            db.ExecuteNonQuery(command, transaction);

            user.UpdatedDate = Convert.ToDateTime(db.GetParameterValue(command, "UpdatedDate").ToString());

            return true;
        }
开发者ID:nirshandileep,项目名称:RHP,代码行数:13,代码来源:UserDAO.cs

示例9: Insert

        public bool Insert(Spotlight spotlight, Database db, DbTransaction transaction)
        {
            DbCommand command = db.GetStoredProcCommand("usp_SpotlightInsert");

            db.AddInParameter(command, "UserId", DbType.Guid, spotlight.UserId);
            db.AddInParameter(command, "Awards", DbType.String, spotlight.Awards);
            db.AddInParameter(command, "Achievements", DbType.String, spotlight.Achievements);
            db.AddInParameter(command, "CurentGPA", DbType.String, spotlight.CurentGPA);
            db.AddInParameter(command, "OraganizationId", DbType.Int16, spotlight.OraganizationId);
            db.AddInParameter(command, "Involvments", DbType.String, spotlight.Involvments);
            db.AddInParameter(command, "FraternityId", DbType.Int16, spotlight.FraternityId);
            db.AddInParameter(command, "SoroityId", DbType.Int16, spotlight.SoroityId);

            db.AddInParameter(command, "GreekHonorSocitiesId", DbType.Int16, spotlight.GreekHonorSocitiesId);
            db.AddInParameter(command, "GreakOrganizationId", DbType.Int16, spotlight.GreakOrganizationId);

            db.AddInParameter(command, "IsDeleted", DbType.Boolean, spotlight.IsDeleted);
            db.AddInParameter(command, "CreatedBy", DbType.Guid, spotlight.CreatedBy);

            db.AddOutParameter(command, "CreatedDate", DbType.DateTime, 30);

            db.ExecuteNonQuery(command, transaction);

            spotlight.CreatedDate = Convert.ToDateTime(db.GetParameterValue(command, "CreatedDate").ToString());
            spotlight.UpdatedDate = spotlight.CreatedDate;

            return true;
        }
开发者ID:nirshandileep,项目名称:RHP,代码行数:28,代码来源:SpotlightDAO.cs

示例10: Insert

        public bool Insert(StudentHouseLeave studentHouseLeave, Database db, DbTransaction transaction)
        {
            DbCommand command = db.GetStoredProcCommand("usp_StudentHouseLeaveInsert");

            db.AddInParameter(command, "HouseId", DbType.Guid, studentHouseLeave.HouseId);
            db.AddInParameter(command, "BaseHouseRoomId", DbType.Guid, studentHouseLeave.BaseHouseRoomId);
            db.AddInParameter(command, "RequestBy", DbType.Guid, studentHouseLeave.RequestBy);
            db.AddInParameter(command, "RequestTo", DbType.Guid, studentHouseLeave.RequestTo);
            db.AddInParameter(command, "status", DbType.Int16, studentHouseLeave.status);
            db.AddOutParameter(command, "RequestDate", DbType.DateTime, 30);

            if (transaction == null)
            {
                db.ExecuteNonQuery(command);
            }
            else
            {
                db.ExecuteNonQuery(command, transaction);
            }

            studentHouseLeave.RequestDate = Convert.ToDateTime(db.GetParameterValue(command, "RequestDate").ToString());
            studentHouseLeave.ResponseDate = studentHouseLeave.RequestDate;

            return true;
        }
开发者ID:nirshandileep,项目名称:RHP,代码行数:25,代码来源:StudentHouseLeaveDAO.cs

示例11: Insert

        public bool Insert(PartialHouse partialHouse, Database db, DbTransaction transaction)
        {
            DbCommand command = db.GetStoredProcCommand("usp_PartialHouseInsert");

            partialHouse.PartialHouseId = Guid.NewGuid();
            db.AddInParameter(command, "PartialHouseId", DbType.Guid, partialHouse.PartialHouseId);
            db.AddInParameter(command, "PartialUserId", DbType.Guid, partialHouse.PartialUserId);
            db.AddInParameter(command, "StateId", DbType.Int32, partialHouse.StateId);
            db.AddInParameter(command, "ZipCode", DbType.String, partialHouse.ZipCode);
            db.AddInParameter(command, "City", DbType.String, partialHouse.City);
            db.AddInParameter(command, "Address", DbType.String, partialHouse.Address);
            db.AddInParameter(command, "IsDeleted", DbType.Boolean, partialHouse.IsDeleted);
            db.AddInParameter(command, "CreatedBy", DbType.Guid, partialHouse.CreatedBy);
            db.AddOutParameter(command, "CreatedDate", DbType.DateTime, 30);

            if (transaction == null)
            {
                db.ExecuteNonQuery(command);
            }
            else
            {
                db.ExecuteNonQuery(command, transaction);
            }

            partialHouse.CreatedDate = Convert.ToDateTime(db.GetParameterValue(command, "CreatedDate").ToString());
            partialHouse.UpdatedDate = partialHouse.CreatedDate;

            return true;
        }
开发者ID:nirshandileep,项目名称:RHP,代码行数:29,代码来源:PartialHouseDAO.cs

示例12: GetDetalleTarjetaLugarPaginacion

        public DetalleTarjetaLugarList GetDetalleTarjetaLugarPaginacion(int IdProyecto, Paginacion oPaginacion, out int RowCount)
        {
            DetalleTarjetaLugarList olista = new DetalleTarjetaLugarList();
            DbCommand oDbCommand = oDatabase.GetStoredProcCommand(DetalleTarjetaLugar.Proc.Paginacion.Str());
            oDatabase.AddInParameter(oDbCommand, "@IdProyecto", DbType.Int32, IdProyecto);
            oDatabase = Pagination.DefaultParams(oDatabase, oDbCommand, oPaginacion);

            using (IDataReader oIDataReader = oDatabase.ExecuteReader(oDbCommand))
            {
                int i1 = oIDataReader.GetOrdinal("IdDetTarjetaLugar");
                int i2 = oIDataReader.GetOrdinal("IdProyecto");
                int i3 = oIDataReader.GetOrdinal("SubRackId");
                int i4 = oIDataReader.GetOrdinal("Slot");
                int i5 = oIDataReader.GetOrdinal("BoardType");
                while (oIDataReader.Read())
                {
                    DetalleTarjetaLugar obj = new DetalleTarjetaLugar();
                    obj.IdDetalleTarjetaLugar = DataUtil.DbValueToDefault<Int32>(oIDataReader[i1]);
                    obj.IdProyecto = DataUtil.DbValueToDefault<Int32>(oIDataReader[i2]);
                    obj.SubRackId = DataUtil.DbValueToDefault<String>(oIDataReader[i3]);
                    obj.Slot = DataUtil.DbValueToDefault<String>(oIDataReader[i4]);
                    obj.BoardType = DataUtil.DbValueToDefault<String>(oIDataReader[i5]);
                    olista.Add(obj);
                }
            }
            RowCount = Convert.ToInt32(oDatabase.GetParameterValue(oDbCommand, "@RowCount"));
            return olista;
        }
开发者ID:Almi645,项目名称:GestionProyecto,代码行数:28,代码来源:ProyectoDetalleDataAccess.cs

示例13: GetBandejaPaginacion

        public ProyectosList GetBandejaPaginacion(Proyectos oPersona, int IdEmpleado,Paginacion oPaginacion, out int RowCount)
        {
            ProyectosList olista = new ProyectosList();
            DbCommand oDbCommand = oDatabase.GetStoredProcCommand(Proyectos.Proc.Bandeja.Str());
            oDatabase.AddInParameter(oDbCommand, "@Codigo", DbType.String, oPersona.Codigo.nullEmpty());
            oDatabase.AddInParameter(oDbCommand, "@IdEmpleado", DbType.Int32, IdEmpleado);
            oDatabase = Pagination.DefaultParams(oDatabase, oDbCommand, oPaginacion);

            using (IDataReader oIDataReader = oDatabase.ExecuteReader(oDbCommand))
            {
                Proyectos obj = new Proyectos();
                int i1 = oIDataReader.GetOrdinal("IdProyecto");
                int i2 = oIDataReader.GetOrdinal("CodProyecto");
                int i3 = oIDataReader.GetOrdinal("DescripProyecto");
                int i4 = oIDataReader.GetOrdinal("NombreEstacion");
                int i5 = oIDataReader.GetOrdinal("TipoEquipo");
                int i6 = oIDataReader.GetOrdinal("NombreEquipo");
                while (oIDataReader.Read())
                {
                    obj = new Proyectos();
                    obj.IdProyecto = DataUtil.DbValueToDefault<Int32>(oIDataReader[i1]);
                    obj.Codigo = DataUtil.DbValueToDefault<String>(oIDataReader[i2]);
                    obj.Descripcion = DataUtil.DbValueToDefault<String>(oIDataReader[i3]);
                    obj.NombreEstacion = DataUtil.DbValueToDefault<String>(oIDataReader[i4]);
                    obj.TipoEquipo = DataUtil.DbValueToDefault<String>(oIDataReader[i5]);
                    obj.NombreEquipo = DataUtil.DbValueToDefault<String>(oIDataReader[i6]);
                    olista.Add(obj);
                }
            }
            RowCount = Convert.ToInt32(oDatabase.GetParameterValue(oDbCommand, "@RowCount"));
            return olista;
        }
开发者ID:Almi645,项目名称:GestionProyecto,代码行数:32,代码来源:ProyectosDataAccess.cs

示例14: Insert

        public bool Insert(Customer customer, Database db, DbTransaction transaction)
        {
            DbCommand command = db.GetStoredProcCommand("usp_CustomerInsert");

            db.AddInParameter(command, "@CompanyId", DbType.Int32, customer.CompanyId);
            db.AddInParameter(command, "@CustomerName", DbType.String, customer.CustomerName);
            db.AddInParameter(command, "@Gender", DbType.String, customer.Gender);
            db.AddInParameter(command, "@GuestTypeId", DbType.Int32, customer.GuestTypeId);
            db.AddInParameter(command, "@Phone", DbType.String, customer.Phone);
            db.AddInParameter(command, "@Fax", DbType.String, customer.Fax);
            db.AddInParameter(command, "@Mobile", DbType.String, customer.Mobile);
            db.AddInParameter(command, "@Email", DbType.String, customer.Email);
            db.AddInParameter(command, "@CompanyName", DbType.String, customer.CompanyName);
            db.AddInParameter(command, "@CompanyAddressLine1", DbType.String, customer.CompanyAddressLine1);
            db.AddInParameter(command, "@CompanyAddressLine2", DbType.String, customer.CompanyAddressLine2);
            db.AddInParameter(command, "@CompanyCity", DbType.String, customer.CompanyCity);
            db.AddInParameter(command, "@CompanyState", DbType.String, customer.CompanyState);
            db.AddInParameter(command, "@CompanyPostCode", DbType.String, customer.CompanyPostCode);
            db.AddInParameter(command, "@CompanyCountryId", DbType.Int32, customer.CompanyCountryId);
            db.AddInParameter(command, "@CompanyNotes", DbType.String, customer.CompanyNotes);
            db.AddInParameter(command, "@BillingAddressLine1", DbType.String, customer.BillingAddressLine1);
            db.AddInParameter(command, "@BillingAddressLine2", DbType.String, customer.BillingAddressLine2);
            db.AddInParameter(command, "@BillingCity", DbType.String, customer.BillingCity);
            db.AddInParameter(command, "@BillingState", DbType.String, customer.BillingState);
            db.AddInParameter(command, "@BillingCountryId", DbType.Int32, customer.BillingCountryId);
            db.AddInParameter(command, "@BillingPostCode", DbType.String, customer.BillingPostCode);
            db.AddInParameter(command, "@PassportNumber", DbType.String, customer.PassportNumber);
            db.AddInParameter(command, "@PassportCountryOfIssue", DbType.Int32, customer.PassportCountryOfIssue);
            db.AddInParameter(command, "@PassportExpirationDate", DbType.DateTime, customer.PassportExpirationDate);
            db.AddInParameter(command, "@CreditCardTypeId", DbType.Int32, customer.CreditCardTypeId);
            db.AddInParameter(command, "@CCNo", DbType.String, customer.CCNo);
            db.AddInParameter(command, "@CCExpirationDate", DbType.DateTime, customer.CCExpirationDate);
            db.AddInParameter(command, "@CCNameOnCard", DbType.String, customer.CCNameOnCard);
            db.AddInParameter(command, "@Car", DbType.String, customer.Car);
            db.AddInParameter(command, "@CarLicensePlate", DbType.String, customer.CarLicensePlate);
            db.AddInParameter(command, "@DriverLicense", DbType.String, customer.DriverLicense);
            db.AddInParameter(command, "@CreatedUser", DbType.Int32, customer.CreatedUser);
            db.AddInParameter(command, "@StatusId", DbType.Int32, customer.StatusId);
            db.AddInParameter(command, "@CardSecurityCode", DbType.String, customer.CardSecurityCode);
            db.AddInParameter(command, "@CardStartDate", DbType.DateTime, customer.CardStartDate);
            db.AddInParameter(command, "@CardIssueNo", DbType.String, customer.CardIssueNo);
            db.AddInParameter(command, "@UseSameBillingAddress", DbType.Boolean, customer.UseSameBillingAddress);
            db.AddInParameter(command, "@IsGroupCustomer", DbType.Boolean, customer.IsGroupCustomer);
            db.AddOutParameter(command, "@CustomerId", DbType.Int32, 8);

            db.ExecuteNonQuery(command, transaction);

            customer.CustomerId = int.Parse(db.GetParameterValue(command, "@CustomerId").ToString());

            return true;
        }
开发者ID:nirshandileep,项目名称:HotelManagement,代码行数:51,代码来源:CustomerDAO.cs

示例15: Insert

        public bool Insert(Roles roles, Database db, DbTransaction transaction)
        {
            DbCommand command = db.GetStoredProcCommand("usp_RolesInsert");

            db.AddInParameter(command, "@CompanyId", DbType.Int32, roles.CompanyId);
            db.AddInParameter(command, "@RoleName", DbType.String, roles.RoleName);
            db.AddInParameter(command, "@RoleDescription", DbType.String, roles.RoleDescription);
            db.AddInParameter(command, "@CreatedUser", DbType.Int32, roles.CreatedUser);
            db.AddOutParameter(command, "@RolesId", DbType.Int32, 8);

            db.ExecuteNonQuery(command, transaction);

            roles.RolesId = Convert.ToInt32(db.GetParameterValue(command, "@RolesId").ToString());

            return true;
        }
开发者ID:nirshandileep,项目名称:HotelManagement,代码行数:16,代码来源:RolesDAO.cs


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