HBM.GeneralManagement.DepartmentsDAO.Insert C# (CSharp) Метод

Insert() публичный Метод

public Insert ( Department department ) : bool
department Department
Результат bool
        public bool Insert(Department department)
        {
            Database db = DatabaseFactory.CreateDatabase(Constants.HBMCONNECTIONSTRING);
            DbCommand command = db.GetStoredProcCommand("usp_DepartmentInsert");

            db.AddInParameter(command, "@CompanyId", DbType.Int32, department.CompanyId);
            db.AddInParameter(command, "@DepartmentName", DbType.String, department.DepartmentName);
            db.AddInParameter(command, "@CreatedBy", DbType.Int32, department.CreatedBy);
            db.AddInParameter(command, "@CreatedDate", DbType.DateTime, department.CreatedDate);

            db.ExecuteNonQuery(command);

            return true;
        }